Changeset 921
- Timestamp:
- 03/22/09 13:53:56 (4 years ago)
- Location:
- branches/transport_redesign/libs/hydrogen/src
- Files:
-
- 3 modified
- 1 moved
-
SeqOutputInterface.h (moved) (moved from branches/transport_redesign/libs/hydrogen/src/SeqClientInterface.h) (4 diffs)
-
SeqScript.h (modified) (6 diffs)
-
Sequencer.cpp (modified) (5 diffs)
-
Sequencer.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/transport_redesign/libs/hydrogen/src/SeqOutputInterface.h
r876 r921 20 20 * 21 21 */ 22 #ifndef H2CORE_SEQ CLIENTINTERFACE_H23 #define H2CORE_SEQ CLIENTINTERFACE_H22 #ifndef H2CORE_SEQOUTPUTINTERFACE_H 23 #define H2CORE_SEQOUTPUTINTERFACE_H 24 24 25 25 #include "SeqScriptIterator.h" … … 33 33 * outputs for the sequencer. 34 34 */ 35 class Seq ClientInterface35 class SeqOutputInterface 36 36 { 37 37 public: 38 virtual ~Seq ClientInterface() {}38 virtual ~SeqOutputInterface() {} 39 39 40 40 /** … … 45 45 * The 'pos' parameter should *not* unless you are *really* needing to 46 46 * map frames back to B:b.t. The 'pos' parameter is intended for 47 * clients that are doing something like MIDI recording (mapping47 * outputs that are doing something like MIDI recording (mapping 48 48 * realtime events back to the B:b.t location in the song. Audio 49 49 * (i.e. the sampler) and MIDI outputs should *not* use the pos … … 60 60 } // namespace H2Core 61 61 62 #endif // H2CORE_SEQ CLIENTINTERFACE_H62 #endif // H2CORE_SEQOUTPUTINTERFACE_H -
branches/transport_redesign/libs/hydrogen/src/SeqScript.h
r876 r921 28 28 /** 29 29 * The SeqScript is how the sequencer communicates events to sequence 30 * clients. It communicates a series of SeqEvents (typically note on/note30 * output clients. It communicates a series of SeqEvents (typically note on/note 31 31 * off stuff). Each event is indexed with an offset to the first frame of the 32 32 * current process() cycle. … … 55 55 * SeqInputInterface* pMidiInput; 56 56 * SeqInputInterface* pGuiInput; 57 * Seq ClientInterface* pSampler; // i.e. H2Core::Sampler58 * Seq ClientInterface* pMidiOut; // i.e. H2Core::MidiOutput57 * SeqOutputInterface* pSampler; // i.e. H2Core::Sampler 58 * SeqOutputInterface* pMidiOut; // i.e. H2Core::MidiOutput 59 59 * 60 60 * // Get events from input sources … … 64 64 * pGuiInput->process(seq, pos, nframes); 65 65 * 66 * // Send events to the clients to be processed.66 * // Send events to the ouput clients to be processed. 67 67 * 68 68 * pSampler->process(seq.begin_const(), … … 78 78 * } 79 79 * 80 * Seq ClientImplementation::process(SeqScriptConstIterator beg,80 * SeqOutputImplementation::process(SeqScriptConstIterator beg, 81 81 * SeqScriptConstIterator end, 82 82 * const TransportPosition& // pos //, … … 91 91 * } 92 92 * 93 * This way, SeqScript is protected from manipulation by Seq uencerClients.93 * This way, SeqScript is protected from manipulation by SeqOutputs. 94 94 * 95 95 */ … … 120 120 * METHODS FOR THE SEQUENCER 121 121 * 122 * These methods should *only* be used by the sequencer. Sequencer 123 * clients should *not* use these. This could possibly be enforced by 124 * always passing the sequencer script to the client as 125 * 'const SequencerScript& script'. 122 * These methods should *only* be used by the sequencer inputs. Sequencer 123 * outputs should *not* use these. 126 124 */ 127 125 /// Reserves memory for a specific number of events. This -
branches/transport_redesign/libs/hydrogen/src/Sequencer.cpp
r888 r921 23 23 #include "Sequencer.h" 24 24 #include "SeqInputInterface.h" 25 #include "Seq ClientInterface.h"25 #include "SeqOutputInterface.h" 26 26 27 27 #include <hydrogen/TransportPosition.h> … … 45 45 { 46 46 inputs_list_t::iterator i; 47 clients_list_t::iterator c;47 outputs_list_t::iterator o; 48 48 int tmp, rv = 0; 49 49 … … 53 53 } 54 54 55 for( c = m_clients.begin() ; c != m_clients.end() ; ++c) {56 tmp = (* c)->process(m_seq.begin_const(), m_seq.end_const(nframes), pos, nframes);55 for( o = m_outputs.begin() ; o != m_outputs.end() ; ++o ) { 56 tmp = (*o)->process(m_seq.begin_const(), m_seq.end_const(nframes), pos, nframes); 57 57 if( tmp ) rv = -1; 58 58 } … … 84 84 } 85 85 86 int Sequencer::add_ client(SeqClientInterface* c)86 int Sequencer::add_output(SeqOutputInterface* o) 87 87 { 88 QMutexLocker lk(&m_ clients_add_mutex);88 QMutexLocker lk(&m_outputs_add_mutex); 89 89 int rv = -1; 90 clients_list_t::iterator k;91 k = find(m_ clients.begin(), m_clients.end(), c);92 if( k != m_ clients.end() ) {93 m_ clients.push_back(c);90 outputs_list_t::iterator k; 91 k = find(m_outputs.begin(), m_outputs.end(), o); 92 if( k != m_outputs.end() ) { 93 m_outputs.push_back(o); 94 94 rv = 0; 95 95 } … … 97 97 } 98 98 99 int Sequencer::remove_ client(SeqClientInterface* c)99 int Sequencer::remove_output(SeqOutputInterface* o) 100 100 { 101 #warning "When we return... it's assumed that it's OK to delete c... but it could still"102 #warning "be in c->process(). How do we protect against that?"103 m_ clients.remove(c);101 #warning "When we return... it's assumed that it's OK to delete o... but it could still" 102 #warning "be in o->process(). How do we protect against that?" 103 m_outputs.remove(o); 104 104 return 0; 105 105 } -
branches/transport_redesign/libs/hydrogen/src/Sequencer.h
r888 r921 34 34 class TransportPosition; 35 35 class SeqInputInterface; 36 class Seq ClientInterface;36 class SeqOutputInterface; 37 37 38 38 /** … … 50 50 int add_input(SeqInputInterface* i); 51 51 int remove_input(SeqInputInterface* i); 52 int add_ client(SeqClientInterface* c);53 int remove_ client(SeqClientInterface* c);52 int add_output(SeqOutputInterface* c); 53 int remove_output(SeqOutputInterface* c); 54 54 55 55 private: 56 56 typedef std::list<SeqInputInterface*> inputs_list_t; 57 typedef std::list<Seq ClientInterface*> clients_list_t;57 typedef std::list<SeqOutputInterface*> outputs_list_t; 58 58 59 59 SeqScript m_seq; … … 61 61 QMutex m_inputs_add_mutex; // Must be locked when adding inputs 62 62 inputs_list_t m_inputs; 63 QMutex m_ clients_add_mutex; // Must be locked when adding clients64 clients_list_t m_clients;63 QMutex m_outputs_add_mutex; // Must be locked when adding outputs 64 outputs_list_t m_outputs; 65 65 }; 66 66