Changeset 921

Show
Ignore:
Timestamp:
03/22/09 13:53:56 (4 years ago)
Author:
gabriel@…
Message:

Rename SeqClientInterface? to SeqOutputInterface?.

This is to be more consistent about the difference with
SeqInputInterface? and make it easier to understand how they relate.
On top of that, both inputs and outputs are actually clients... not
just the outputs.

Location:
branches/transport_redesign/libs/hydrogen/src
Files:
3 modified
1 moved

Legend:

Unmodified
Added
Removed
  • branches/transport_redesign/libs/hydrogen/src/SeqOutputInterface.h

    r876 r921  
    2020 * 
    2121 */ 
    22 #ifndef H2CORE_SEQCLIENTINTERFACE_H 
    23 #define H2CORE_SEQCLIENTINTERFACE_H 
     22#ifndef H2CORE_SEQOUTPUTINTERFACE_H 
     23#define H2CORE_SEQOUTPUTINTERFACE_H 
    2424 
    2525#include "SeqScriptIterator.h" 
     
    3333     * outputs for the sequencer. 
    3434     */ 
    35     class SeqClientInterface 
     35    class SeqOutputInterface 
    3636    { 
    3737    public: 
    38         virtual ~SeqClientInterface() {} 
     38        virtual ~SeqOutputInterface() {} 
    3939 
    4040        /** 
     
    4545         * The 'pos' parameter should *not* unless you are *really* needing to 
    4646         * map frames back to B:b.t.  The 'pos' parameter is intended for 
    47          * clients that are doing something like MIDI recording (mapping 
     47         * outputs that are doing something like MIDI recording (mapping 
    4848         * realtime events back to the B:b.t location in the song.  Audio 
    4949         * (i.e. the sampler) and MIDI outputs should *not* use the pos 
     
    6060} // namespace H2Core 
    6161 
    62 #endif // H2CORE_SEQCLIENTINTERFACE_H 
     62#endif // H2CORE_SEQOUTPUTINTERFACE_H 
  • branches/transport_redesign/libs/hydrogen/src/SeqScript.h

    r876 r921  
    2828/** 
    2929 * The SeqScript is how the sequencer communicates events to sequence 
    30  * clients.  It communicates a series of SeqEvents (typically note on/note 
     30 * output clients.  It communicates a series of SeqEvents (typically note on/note 
    3131 * off stuff).  Each event is indexed with an offset to the first frame of the 
    3232 * current process() cycle. 
     
    5555     *         SeqInputInterface* pMidiInput; 
    5656     *         SeqInputInterface* pGuiInput; 
    57      *         SeqClientInterface* pSampler; // i.e. H2Core::Sampler 
    58      *         SeqClientInterface* pMidiOut; // i.e. H2Core::MidiOutput 
     57     *         SeqOutputInterface* pSampler; // i.e. H2Core::Sampler 
     58     *         SeqOutputInterface* pMidiOut; // i.e. H2Core::MidiOutput 
    5959     * 
    6060     *         // Get events from input sources 
     
    6464     *         pGuiInput->process(seq, pos, nframes); 
    6565     * 
    66      *         // Send events to the clients to be processed. 
     66     *         // Send events to the ouput clients to be processed. 
    6767     * 
    6868     *         pSampler->process(seq.begin_const(), 
     
    7878     *     } 
    7979     * 
    80      *     SeqClientImplementation::process(SeqScriptConstIterator beg, 
     80     *     SeqOutputImplementation::process(SeqScriptConstIterator beg, 
    8181     *                                      SeqScriptConstIterator end, 
    8282     *                                      const TransportPosition& // pos //, 
     
    9191     *     } 
    9292     * 
    93      * This way, SeqScript is protected from manipulation by SequencerClients. 
     93     * This way, SeqScript is protected from manipulation by SeqOutputs. 
    9494     * 
    9595     */ 
     
    120120         * METHODS FOR THE SEQUENCER 
    121121         * 
    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. 
    126124         */ 
    127125        /// Reserves memory for a specific number of events.  This 
  • branches/transport_redesign/libs/hydrogen/src/Sequencer.cpp

    r888 r921  
    2323#include "Sequencer.h" 
    2424#include "SeqInputInterface.h" 
    25 #include "SeqClientInterface.h" 
     25#include "SeqOutputInterface.h" 
    2626 
    2727#include <hydrogen/TransportPosition.h> 
     
    4545{ 
    4646    inputs_list_t::iterator i; 
    47     clients_list_t::iterator c; 
     47    outputs_list_t::iterator o; 
    4848    int tmp, rv = 0; 
    4949 
     
    5353    } 
    5454 
    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); 
    5757        if( tmp ) rv = -1; 
    5858    } 
     
    8484} 
    8585 
    86 int Sequencer::add_client(SeqClientInterface* c) 
     86int Sequencer::add_output(SeqOutputInterface* o) 
    8787{ 
    88     QMutexLocker lk(&m_clients_add_mutex); 
     88    QMutexLocker lk(&m_outputs_add_mutex); 
    8989    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); 
    9494        rv = 0; 
    9595    } 
     
    9797} 
    9898 
    99 int Sequencer::remove_client(SeqClientInterface* c) 
     99int Sequencer::remove_output(SeqOutputInterface* o) 
    100100{ 
    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); 
    104104    return 0; 
    105105} 
  • branches/transport_redesign/libs/hydrogen/src/Sequencer.h

    r888 r921  
    3434    class TransportPosition; 
    3535    class SeqInputInterface; 
    36     class SeqClientInterface; 
     36    class SeqOutputInterface; 
    3737 
    3838    /** 
     
    5050        int add_input(SeqInputInterface* i); 
    5151        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); 
    5454 
    5555    private: 
    5656        typedef std::list<SeqInputInterface*> inputs_list_t; 
    57         typedef std::list<SeqClientInterface*> clients_list_t; 
     57        typedef std::list<SeqOutputInterface*> outputs_list_t; 
    5858 
    5959        SeqScript m_seq; 
     
    6161        QMutex m_inputs_add_mutex;   // Must be locked when adding inputs 
    6262        inputs_list_t m_inputs; 
    63         QMutex m_clients_add_mutex;  // Must be locked when adding clients 
    64         clients_list_t m_clients; 
     63        QMutex m_outputs_add_mutex;  // Must be locked when adding outputs 
     64        outputs_list_t m_outputs; 
    6565    }; 
    6666