Etterna
0.74.4
Loading...
Searching...
No Matches
src
arch
InputHandler
InputHandler_SextetStream.h
1
#ifndef INPUT_HANDLER_SEXTETSTREAM
2
#define INPUT_HANDLER_SEXTETSTREAM
3
4
#include "InputHandler.h"
5
#include <cstdio>
6
7
class
InputHandler_SextetStream
:
public
InputHandler
8
{
9
public
:
10
InputHandler_SextetStream
();
11
virtual
~InputHandler_SextetStream
();
12
// virtual void Update();
13
virtual
void
GetDevicesAndDescriptions(
14
std::vector<InputDeviceInfo>& vDevicesOut);
15
16
public
:
17
class
Impl
;
18
19
protected
:
20
Impl
* _impl;
21
};
22
23
// Note: InputHandler_SextetStreamFromFile uses blocking I/O. For the
24
// handler thread to close in a timely fashion, the producer of data for the
25
// file (e.g. the program at the other end of the pipe) must either close
26
// the file or output and flush a line of data no less often than about once
27
// per second, even if there has been no change. (Repeating the most recent
28
// state accomplishes this without triggering any new events.) Either of
29
// these interrupts the blocking read so that the loop can check its
30
// continue flag.
31
class
InputHandler_SextetStreamFromFile
:
public
InputHandler_SextetStream
32
{
33
public
:
34
// Note: In the current implementation, the filename (either the
35
// `filename` parameter or the `SextetStreamInputFilename` setting) is
36
// passed to fopen(), not a RageFile ctor, so specify the file to be
37
// opened on the actual filesystem instead of the mapped filesystem. (I
38
// couldn't get RageFile to work here, possibly because I haven't
39
// determined how to disable buffering on an input file.)
40
InputHandler_SextetStreamFromFile
();
41
InputHandler_SextetStreamFromFile
(
const
std::string& filename);
42
43
// The file object passed here must already be open and buffering should
44
// be disabled. The file object will be closed in the destructor.
45
InputHandler_SextetStreamFromFile
(std::FILE* file);
46
};
47
48
#endif
49
50
/*
51
* Copyright © 2014 Peter S. May
52
*
53
* Permission is hereby granted, free of charge, to any person obtaining a
54
* copy of this software and associated documentation files (the
55
* "Software"), to deal in the Software without restriction, including
56
* without limitation the rights to use, copy, modify, merge, publish,
57
* distribute, sublicense, and/or sell copies of the Software, and to permit
58
* persons to whom the Software is furnished to do so, subject to the
59
* following conditions:
60
*
61
* The above copyright notice and this permission notice shall be included
62
* in all copies or substantial portions of the Software.
63
*
64
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
65
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
66
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
67
* NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
68
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
69
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
70
* USE OR OTHER DEALINGS IN THE SOFTWARE.
71
*/
InputHandler_SextetStreamFromFile
Definition
InputHandler_SextetStream.h:32
InputHandler_SextetStream::Impl
Definition
InputHandler_SextetStream.cpp:73
InputHandler_SextetStream
Definition
InputHandler_SextetStream.h:8
InputHandler
A class designed to handle special input devices.
Definition
InputHandler.h:23
Generated by
1.9.8