00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef DRUMSTICK_SUBSCRIPTION_H
00022 #define DRUMSTICK_SUBSCRIPTION_H
00023
00024 #include "drumstickcommon.h"
00025 #include <QList>
00026
00034 namespace drumstick {
00035
00036 class MidiClient;
00037
00043 class DRUMSTICK_EXPORT Subscriber
00044 {
00045 friend class PortInfo;
00046 public:
00047 Subscriber();
00048 Subscriber(const Subscriber& other);
00049 Subscriber(snd_seq_query_subscribe_t* other);
00050 virtual ~Subscriber();
00051 Subscriber* clone();
00052 int getSizeOfInfo() const;
00053
00054 int getClient();
00055 int getPort();
00056 const snd_seq_addr_t* getRoot();
00057 snd_seq_query_subs_type_t getType();
00058 int getIndex();
00059 int getNumSubs();
00060 const snd_seq_addr_t* getAddr();
00061 int getQueue();
00062 bool getExclusive();
00063 bool getTimeUpdate();
00064 bool getTimeReal();
00065 void setClient(int client);
00066 void setPort(int port);
00067 void setRoot(snd_seq_addr_t* addr);
00068 void setType(snd_seq_query_subs_type_t type);
00069 void setIndex(int index);
00070 Subscriber& operator=(const Subscriber& other);
00071
00072 private:
00073 snd_seq_query_subscribe_t* m_Info;
00074
00075 };
00076
00082 class DRUMSTICK_EXPORT Subscription
00083 {
00084 public:
00085 Subscription();
00086 Subscription(const Subscription& other);
00087 Subscription(snd_seq_port_subscribe_t* other);
00088 Subscription(MidiClient* seq);
00089 virtual ~Subscription();
00090 Subscription* clone();
00091 int getSizeOfInfo() const;
00092
00093 void setSender(unsigned char client, unsigned char port);
00094 void setDest(unsigned char client, unsigned char port);
00095 void subscribe(MidiClient* seq);
00096 void unsubscribe(MidiClient* seq);
00097
00098 const snd_seq_addr_t* getSender();
00099 const snd_seq_addr_t* getDest();
00100 int getQueue();
00101 bool getExclusive();
00102 bool getTimeUpdate();
00103 bool getTimeReal();
00104 void setSender(const snd_seq_addr_t* addr);
00105 void setDest(const snd_seq_addr_t* addr);
00106 void setQueue(int queue);
00107 void setExclusive(bool val);
00108 void setTimeUpdate(bool val);
00109 void setTimeReal(bool val);
00110 Subscription& operator=(const Subscription& other);
00111
00112 private:
00113 snd_seq_port_subscribe_t* m_Info;
00114 };
00115
00119 typedef QList<Subscription> SubscriptionsList;
00120
00124 typedef QList<Subscriber> SubscribersList;
00125
00126 }
00127
00130 #endif //DRUMSTICK_SUBSCRIPTION_H