void WinMIDIStreamer::Pause(int setPause)
{
    playing = !setPause;
    if(setPause)
        midiStreamPause(midiStr);
    else
        midiStreamRestart(midiStr);
}
void native_midi_pause(int pauseon) //maks
{
	static int pause = 0;
	if(hMidiStream)
	{
		if(pauseon && !pause)
		{
			midiStreamPause(hMidiStream);
			pause = 1;
		}
		else if(!pauseon && pause)
		{
			midiStreamRestart(hMidiStream);
			pause = 0;
		}
	}
}
Beispiel #3
0
static void FAR PASCAL s_MidiCallback(HMIDISTRM hms, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2) {
	WinmidiObject *obj = (WinmidiObject *) dwUser;
	int retVal;

	UNUSED(hms);
	UNUSED(dw1);
	UNUSED(dw2);

	assert(obj);

	/* Only process Done messages. */
	if(uMsg != MOM_DONE) {
	return;
	}

	while(obj->m_playNode) {
	/* Clear the playing flag. */
	obj->m_playNode->m_blockState = BLOCK_PLAYED;

	/* Play the next block, if available. */
	obj->m_playNode = obj->m_playNode->m_next;
	if(obj->m_playNode) {
		/* Check to see if we have exhausted the ready blocks. */
		if(obj->m_playNode->m_blockState != BLOCK_READY) {
		return;
		}

		obj->m_playNode->m_blockState = BLOCK_PLAYING;

		retVal = midiStreamOut(obj->m_midiOut, &obj->m_playNode->m_header,
			sizeof(obj->m_playNode->m_header));
		if(retVal == MMSYSERR_NOERROR) {
		return;
		} else {
		fprintf(stderr, "Error occurred while advancing MIDI block pointer.\n");
		}
	} else {
		retVal = midiStreamPause(obj->m_midiOut);
		if(retVal != MMSYSERR_NOERROR) {
		fprintf(stderr, "Error occurred while pausing MIDI playback.");
		}
		return;
	}
	}
}
Beispiel #4
0
void MPU_Pause(void)
{
	if (hmido != (HMIDISTRM)-1) midiStreamPause(hmido);
}
void native_midi_pause(void)
{
  if (!hMidiStream)
    return;
  midiStreamPause(hMidiStream);
}