/[svn]/linuxsampler/trunk/src/network/lscpevent.h
ViewVC logotype

Contents of /linuxsampler/trunk/src/network/lscpevent.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1765 - (show annotations) (download) (as text)
Sat Sep 6 16:44:42 2008 UTC (15 years, 7 months ago) by persson
File MIME type: text/x-c++hdr
File size: 4518 byte(s)
* refactoring: extracted lscp notification from main() to a separate
  function
* added helper function MidiInputPort::DispatchRaw for midi device
  implementations with raw byte data
* fixed a win32 build error (atomic.h is working on windows too)
* code cleanup: moved lscp classes into LinuxSampler namespace

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005 - 2008 Christian Schoenebeck *
7 * *
8 * This program is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU General Public License as published by *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24 #ifndef __LSCPEVENT_H_
25 #define __LSCPEVENT_H_
26 #include <iostream>
27 #include <sstream>
28 #include <string>
29 #include <list>
30 #include "../Sampler.h"
31 #include "../common/global.h"
32 #include "../common/Exception.h"
33
34 namespace LinuxSampler {
35
36 /**
37 * Helper class for producing result sets
38 */
39 class LSCPEvent {
40 public:
41 /**
42 * Event types
43 **/
44 enum event_t {
45 event_audio_device_count,
46 event_audio_device_info,
47 event_midi_device_count,
48 event_midi_device_info,
49 event_channel_count,
50 event_voice_count,
51 event_stream_count,
52 event_buffer_fill,
53 event_channel_info,
54 event_fx_send_count,
55 event_fx_send_info,
56 event_midi_instr_map_count,
57 event_midi_instr_map_info,
58 event_midi_instr_count,
59 event_midi_instr_info,
60 event_db_instr_dir_count,
61 event_db_instr_dir_info,
62 event_db_instr_count,
63 event_db_instr_info,
64 event_db_instrs_job_info,
65 event_misc,
66 event_total_stream_count,
67 event_total_voice_count,
68 event_global_info,
69 event_channel_midi,
70 event_device_midi
71 };
72
73 /* This constructor will do type lookup based on name
74 **/
75 LSCPEvent(String eventName) throw (Exception);
76
77 /* These constructors are used to create event and fill it with data for sending
78 * These will be used by the thread that wants to send an event to all clients
79 * that are subscribed to it
80 **/
81 LSCPEvent(event_t eventType, int uiData);
82 LSCPEvent(event_t eventType, String sData);
83 LSCPEvent(event_t eventType, int uiData1, int uiData2);
84 LSCPEvent(event_t eventType, int uiData1, int uiData2, String sData3, int uiData4, int uiData5);
85 LSCPEvent(event_t eventType, String sData, int uiData);
86 LSCPEvent(event_t eventType, String sData, double dData);
87 LSCPEvent(event_t eventType, int uiData, String sData);
88 LSCPEvent(event_t eventType, int uiData1, String sData2, int uiData3, int uiData4);
89 LSCPEvent(event_t eventType, int uiData1, int uiData2, int uiData3);
90 LSCPEvent(event_t eventType, String sData1, String sData2, String sData3);
91 String Produce( void );
92
93 /* Returns event type */
94 event_t GetType( void ) { return type; }
95
96 /* These methods are used to registed and unregister an event */
97 static void RegisterEvent(event_t eventType, String EventName);
98 static void UnregisterEvent(event_t eventType);
99
100 /* This method returns a name for events of a given type */
101 static String Name(event_t eventType);
102
103 /* This method returs a list of all event types registered */
104 static std::list<event_t> List( void );
105
106 private:
107 String storage;
108 event_t type;
109
110 static std::map<event_t, String> EventNames;
111 };
112
113 }
114
115 #endif // __LSCPEVENT_H_

  ViewVC Help
Powered by ViewVC