~mixxxdevelopers/mixxx/fixes_soundcardSync

« back to all changes in this revision

Viewing changes to mixxx/src/midi/mididevice.h

  • Committer: Albert Santoni
  • Date: 2010-11-02 06:39:35 UTC
  • Revision ID: alberts@mixxx.org-20101102063935-vaur40f1nsx1aqh7
* Renamed m_mappingMutex to m_mappingPtrMutex for a little bit more clarity.
* Added an m_bSendInhibit flag (setSendInhibit(bool)) that prevents a race condition when the MIDI scripting engine tries to send a message while we're shutting it down.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        void receive(MidiStatusByte status, char channel, char control, char value);
66
66
        bool midiDebugging();
67
67
        void setReceiveInhibit(bool inhibit);
 
68
        void setSendInhibit(bool inhibit);
68
69
    public slots:
69
70
        void disableMidiLearn();
70
71
        void enableMidiLearn();
95
96
        bool m_midiDebug;
96
97
        /** Mutex to protect against concurrent access to member variables */
97
98
        QMutex m_mutex;
98
 
        /** Mutex to protect against concurrent access to m_pMidiMapping. */
99
 
        QMutex m_mappingMutex;
 
99
        /** Mutex to protect against concurrent access to the m_pMidiMapping _pointer. Note that MidiMapping itself is thread-safe, so we just need to protect the pointer!. */
 
100
        QMutex m_mappingPtrMutex;
100
101
        /** A flag to inhibit the reception of messages from this device. This is used to prevent
101
102
            a race condition when a MIDI message is received and looked up in the MidiMapping while
102
103
            the MidiMapping is being modified (and is already locked).  */
103
104
        bool m_bReceiveInhibit;
 
105
        /** A flag to inhibit the sending of MIDI messages to the MIDI device.
 
106
            Similar to the above flag, this prevents race conditions, 
 
107
            particularly one where the scripting engine tries to send a 
 
108
            MIDI message while we're trying to shut it down. See
 
109
            MidiDevice::shutdown() for more details. */
 
110
        bool m_bSendInhibit;
104
111
};
105
112
 
106
113
#endif