implemented Tempo Change event
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2933 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -243,7 +243,6 @@ void BMidiLocalConsumer::Data(
|
|||||||
case B_CONTINUE:
|
case B_CONTINUE:
|
||||||
case B_STOP:
|
case B_STOP:
|
||||||
case B_ACTIVE_SENSING:
|
case B_ACTIVE_SENSING:
|
||||||
case B_SYSTEM_RESET:
|
|
||||||
{
|
{
|
||||||
if (length == 1)
|
if (length == 1)
|
||||||
{
|
{
|
||||||
@@ -251,6 +250,22 @@ void BMidiLocalConsumer::Data(
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case B_SYSTEM_RESET:
|
||||||
|
{
|
||||||
|
if (length == 1)
|
||||||
|
{
|
||||||
|
SystemRealTime(data[0], time);
|
||||||
|
}
|
||||||
|
else if ((length == 6) && (data[1] == 0x51)
|
||||||
|
&& (data[2] == 0x03))
|
||||||
|
{
|
||||||
|
int32 tempo =
|
||||||
|
(data[3] << 16) | (data[4] << 8) | data[5];
|
||||||
|
|
||||||
|
TempoChange(60000000/tempo, time);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -277,7 +277,17 @@ void BMidiLocalProducer::SpraySystemRealTime(
|
|||||||
void BMidiLocalProducer::SprayTempoChange(
|
void BMidiLocalProducer::SprayTempoChange(
|
||||||
int32 beatsPerMinute, bigtime_t time) const
|
int32 beatsPerMinute, bigtime_t time) const
|
||||||
{
|
{
|
||||||
// This method does nothing, just like the BeOS R5 Midi Kit.
|
int32 tempo = 60000000 / beatsPerMinute;
|
||||||
|
|
||||||
|
uchar data[6];
|
||||||
|
data[0] = 0xFF;
|
||||||
|
data[1] = 0x51;
|
||||||
|
data[2] = 0x03;
|
||||||
|
data[3] = tempo >> 16;
|
||||||
|
data[4] = tempo >> 8;
|
||||||
|
data[5] = tempo;
|
||||||
|
|
||||||
|
SprayEvent(&data, 6, true, time);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user