Rename MidiTime to TimePos (#5684)

Fixes #4866
This commit is contained in:
Alexandre Almeida
2020-11-29 15:46:13 -03:00
committed by GitHub
parent a2e71c81de
commit 6e081265ba
82 changed files with 622 additions and 618 deletions

View File

@@ -134,7 +134,7 @@ void Lv2Instrument::loadFile(const QString &file)
#ifdef LV2_INSTRUMENT_USE_MIDI
bool Lv2Instrument::handleMidiEvent(
const MidiEvent &event, const MidiTime &time, f_cnt_t offset)
const MidiEvent &event, const TimePos &time, f_cnt_t offset)
{
// this function can be called from GUI threads while the plugin is running
// handleMidiInputEvent will use a thread-safe ringbuffer

View File

@@ -66,7 +66,7 @@ public:
bool hasNoteInput() const override { return Lv2ControlBase::hasNoteInput(); }
#ifdef LV2_INSTRUMENT_USE_MIDI
bool handleMidiEvent(const MidiEvent &event,
const MidiTime &time = MidiTime(), f_cnt_t offset = 0) override;
const TimePos &time = TimePos(), f_cnt_t offset = 0) override;
#else
void playNote(NotePlayHandle *nph, sampleFrame *) override;
#endif

View File

@@ -43,7 +43,7 @@
#include "Instrument.h"
#include "GuiApplication.h"
#include "MainWindow.h"
#include "MidiTime.h"
#include "TimePos.h"
#include "debug.h"
#include "Song.h"
@@ -160,7 +160,7 @@ public:
AutomationTrack * at;
AutomationPattern * ap;
MidiTime lastPos;
TimePos lastPos;
smfMidiCC & create( TrackContainer* tc, QString tn )
{
@@ -187,11 +187,11 @@ public:
}
smfMidiCC & putValue( MidiTime time, AutomatableModel * objModel, float value )
smfMidiCC & putValue( TimePos time, AutomatableModel * objModel, float value )
{
if( !ap || time > lastPos + DefaultTicksPerBar )
{
MidiTime pPos = MidiTime( time.getBar(), 0 );
TimePos pPos = TimePos( time.getBar(), 0 );
ap = dynamic_cast<AutomationPattern*>(
at->createTCO(pPos));
ap->addObject( objModel );
@@ -200,7 +200,7 @@ public:
lastPos = time;
time = time - ap->startPosition();
ap->putValue( time, value, false );
ap->changeLength( MidiTime( time.getBar() + 1, 0 ) );
ap->changeLength( TimePos( time.getBar() + 1, 0 ) );
return *this;
}
@@ -278,14 +278,14 @@ public:
void splitPatterns()
{
Pattern * newPattern = nullptr;
MidiTime lastEnd(0);
TimePos lastEnd(0);
p->rearrangeAllNotes();
for (auto n : p->notes())
{
if (!newPattern || n->pos() > lastEnd + DefaultTicksPerBar)
{
MidiTime pPos = MidiTime(n->pos().getBar(), 0);
TimePos pPos = TimePos(n->pos().getBar(), 0);
newPattern = dynamic_cast<Pattern*>(it->createTCO(pPos));
}
lastEnd = n->pos() + n->length();

View File

@@ -293,7 +293,7 @@ int OpulenzInstrument::pushVoice(int v) {
return i;
}
bool OpulenzInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
bool OpulenzInstrument::handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset )
{
emulatorMutex.lock();
int key, vel, voice, tmp_pb;

View File

@@ -56,7 +56,7 @@ public:
return IsSingleStreamed | IsMidiBased;
}
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset = 0 );
virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 );
virtual void play( sampleFrame * _working_buffer );
void saveSettings( QDomDocument & _doc, QDomElement & _this );

View File

@@ -355,7 +355,7 @@ void CarlaInstrument::play(sampleFrame* workingBuffer)
instrumentTrack()->processAudioBuffer(workingBuffer, bufsize, NULL);
}
bool CarlaInstrument::handleMidiEvent(const MidiEvent& event, const MidiTime&, f_cnt_t offset)
bool CarlaInstrument::handleMidiEvent(const MidiEvent& event, const TimePos&, f_cnt_t offset)
{
const QMutexLocker ml(&fMutex);

View File

@@ -72,7 +72,7 @@ public:
virtual void saveSettings(QDomDocument& doc, QDomElement& parent);
virtual void loadSettings(const QDomElement& elem);
virtual void play(sampleFrame* workingBuffer);
virtual bool handleMidiEvent(const MidiEvent& event, const MidiTime& time, f_cnt_t offset);
virtual bool handleMidiEvent(const MidiEvent& event, const TimePos& time, f_cnt_t offset);
virtual PluginView* instantiateView(QWidget* parent);
signals:

View File

@@ -48,7 +48,6 @@ float frnd(float range)
#include "ToolTip.h"
#include "Song.h"
#include "MidiEvent.h"
#include "MidiTime.h"
#include "Mixer.h"
#include "embed.h"

View File

@@ -411,7 +411,7 @@ void vestigeInstrument::play( sampleFrame * _buf )
bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
bool vestigeInstrument::handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset )
{
m_pluginMutex.lock();
if( m_plugin != NULL )

View File

@@ -67,7 +67,7 @@ public:
return IsSingleStreamed | IsMidiBased;
}
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset = 0 );
virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 );
virtual PluginView * instantiateView( QWidget * _parent );

View File

@@ -351,7 +351,7 @@ void ZynAddSubFxInstrument::play( sampleFrame * _buf )
bool ZynAddSubFxInstrument::handleMidiEvent( const MidiEvent& event, const MidiTime& time, f_cnt_t offset )
bool ZynAddSubFxInstrument::handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset )
{
// do not forward external MIDI Control Change events if the according
// LED is not checked

View File

@@ -70,7 +70,7 @@ public:
virtual void play( sampleFrame * _working_buffer );
virtual bool handleMidiEvent( const MidiEvent& event, const MidiTime& time = MidiTime(), f_cnt_t offset = 0 );
virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time = TimePos(), f_cnt_t offset = 0 );
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
virtual void loadSettings( const QDomElement & _this );