13
0

NO-OP: whitespace

This commit is contained in:
Robin Gareus 2020-05-29 23:03:46 +02:00
parent 8e52ea74da
commit 677f4b4e53
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 139 additions and 135 deletions

View File

@ -26,15 +26,14 @@
#include "pbd/signals.h" #include "pbd/signals.h"
#include "ardour/libardour_visibility.h" #include "ardour/libardour_visibility.h"
#include "ardour/types.h"
#include "ardour/session_handle.h" #include "ardour/session_handle.h"
#include "ardour/types.h"
#ifndef __libardour_ticker_h__ #ifndef __libardour_ticker_h__
#define __libardour_ticker_h__ #define __libardour_ticker_h__
namespace ARDOUR { namespace ARDOUR
{
class Session; class Session;
class MidiPort; class MidiPort;
@ -46,7 +45,10 @@ public:
void tick (const samplepos_t& transport_samples, pframes_t nframes); void tick (const samplepos_t& transport_samples, pframes_t nframes);
bool has_midi_port() const { return _midi_port != 0; } bool has_midi_port () const
{
return _midi_port != 0;
}
void set_session (Session* s); void set_session (Session* s);
void session_going_away (); void session_going_away ();
@ -64,10 +66,14 @@ public:
void session_located (); void session_located ();
/// pulses per quarter note (default 24) /// pulses per quarter note (default 24)
void set_ppqn(int ppqn) { _ppqn = ppqn; } void set_ppqn (int ppqn)
{
_ppqn = ppqn;
}
private: private:
boost::shared_ptr<MidiPort> _midi_port; boost::shared_ptr<MidiPort> _midi_port;
int _ppqn; int _ppqn;
double _last_tick; double _last_tick;
bool _send_pos; bool _send_pos;
@ -84,7 +90,7 @@ public:
void send_stop_event (pframes_t offset, pframes_t nframes); void send_stop_event (pframes_t offset, pframes_t nframes);
void send_position_event (uint32_t midi_clocks, pframes_t offset, pframes_t nframes); void send_position_event (uint32_t midi_clocks, pframes_t offset, pframes_t nframes);
}; };
} } // namespace ARDOUR
// namespace // namespace
#endif /* __libardour_ticker_h__ */ #endif /* __libardour_ticker_h__ */

View File

@ -29,13 +29,13 @@
#include "ardour/async_midi_port.h" #include "ardour/async_midi_port.h"
#include "ardour/audioengine.h" #include "ardour/audioengine.h"
#include "ardour/debug.h"
#include "ardour/lmath.h"
#include "ardour/midi_buffer.h" #include "ardour/midi_buffer.h"
#include "ardour/midi_port.h" #include "ardour/midi_port.h"
#include "ardour/lmath.h"
#include "ardour/ticker.h"
#include "ardour/session.h" #include "ardour/session.h"
#include "ardour/tempo.h" #include "ardour/tempo.h"
#include "ardour/debug.h" #include "ardour/ticker.h"
using namespace ARDOUR; using namespace ARDOUR;
using namespace PBD; using namespace PBD;
@ -44,16 +44,20 @@ using namespace PBD;
class MidiClockTicker::Position : public Timecode::BBT_Time class MidiClockTicker::Position : public Timecode::BBT_Time
{ {
public: public:
Position ()
Position() : speed(0.0f), sample(0), midi_beats(0) { } : speed (0.0f)
, sample (0)
, midi_beats (0)
{
}
~Position () {} ~Position () {}
/** Sync timing information taken from the given Session /** Sync timing information taken from the given Session
* @return True if timings differed * @return True if timings differed
*/ */
bool sync (Session* s) { bool sync (Session* s)
{
bool changed = false; bool changed = false;
double sp = s->transport_speed (); double sp = s->transport_speed ();
@ -103,12 +107,12 @@ public:
double midi_beats; double midi_beats;
double midi_clocks; double midi_clocks;
void print (std::ostream& s) { void print (std::ostream& s)
{
s << "samples: " << sample << " midi beats: " << midi_beats << " speed: " << speed; s << "samples: " << sample << " midi beats: " << midi_beats << " speed: " << speed;
} }
}; };
MidiClockTicker::MidiClockTicker () MidiClockTicker::MidiClockTicker ()
: _ppqn (24) : _ppqn (24)
, _last_tick (0.0) , _last_tick (0.0)
@ -188,8 +192,7 @@ MidiClockTicker::transport_state_changed()
DEBUG_TRACE (DEBUG::MidiClock, DEBUG_TRACE (DEBUG::MidiClock,
string_compose ("Transport state change @ %4, speed: %1 position: %2 play loop: %3\n", string_compose ("Transport state change @ %4, speed: %1 position: %2 play loop: %3\n",
_pos->speed, _pos->sample, _session->get_play_loop(), _pos->sample) _pos->speed, _pos->sample, _session->get_play_loop (), _pos->sample));
);
_last_tick = _pos->sample; _last_tick = _pos->sample;
@ -198,8 +201,6 @@ MidiClockTicker::transport_state_changed()
} }
_send_state = true; _send_state = true;
// tick (_pos->sample);
} }
void void
@ -210,8 +211,7 @@ MidiClockTicker::transport_looped()
DEBUG_TRACE (DEBUG::MidiClock, DEBUG_TRACE (DEBUG::MidiClock,
string_compose ("Transport looped, position: %1, loop start: %2, loop end: %3, play loop: %4\n", string_compose ("Transport looped, position: %1, loop start: %2, loop end: %3, play loop: %4\n",
_session->transport_sample(), loop_location->start(), loop_location->end(), _session->get_play_loop()) _session->transport_sample (), loop_location->start (), loop_location->end (), _session->get_play_loop ()));
);
// adjust _last_tick, so that the next MIDI clock message is sent // adjust _last_tick, so that the next MIDI clock message is sent
// in due time (and the tick interval is still constant) // in due time (and the tick interval is still constant)
@ -226,7 +226,7 @@ MidiClockTicker::transport_looped()
} }
void void
MidiClockTicker::tick (const samplepos_t& /* transport_sample */, pframes_t nframes) MidiClockTicker::tick (const samplepos_t& transport_sample, pframes_t nframes)
{ {
if (!Config->get_send_midi_clock () || _session == 0 || _midi_port == 0) { if (!Config->get_send_midi_clock () || _session == 0 || _midi_port == 0) {
return; return;
@ -251,7 +251,6 @@ MidiClockTicker::tick (const samplepos_t& /* transport_sample */, pframes_t nfra
_send_pos = false; _send_pos = false;
} }
if (_send_state) { if (_send_state) {
if (_pos->speed == 1.0f) { if (_pos->speed == 1.0f) {
if (_session->get_play_loop ()) { if (_session->get_play_loop ()) {
@ -398,5 +397,4 @@ MidiClockTicker::send_position_event (uint32_t midi_beats, pframes_t offset, pfr
mb.push_back (offset, 3, &msg[0]); mb.push_back (offset, 3, &msg[0]);
DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Song Position Sent: %1 to %2 (events now %3, buf = %4)\n", midi_beats, _midi_port->name (), mb.size (), &mb)); DEBUG_TRACE (DEBUG::MidiClock, string_compose ("Song Position Sent: %1 to %2 (events now %3, buf = %4)\n", midi_beats, _midi_port->name (), mb.size (), &mb));
} }