[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
Go Back  Xtreme Visual Basic Talk > > > [C\C++ - mciSendString] - how testing if is playing?


Reply
 
Thread Tools Display Modes
  #1  
Old 03-11-2013, 03:44 PM
Cambalinho_83's Avatar
Cambalinho_83 Cambalinho_83 is offline
Senior Contributor
 
Join Date: Feb 2008
Location: somewhere in space
Posts: 1,293
Default [C\C++ - mciSendString] - how testing if is playing?


i have a Sound class:
Code:
class Sound
{
	public: char *FileName;

	public: void Play()
	{	
		char shortBuffer[MAX_PATH];
		char command[256] = {'\0'};

		GetShortPathNameA(FileName, shortBuffer, sizeof(shortBuffer) );
		
		sprintf(command, "close %s", shortBuffer);
		mciSendString(command, 0, 0, 0);
		sprintf(command, "play %s", shortBuffer);
		mciSendString(command, 0, 0, 0);
		
	}

	public: int IsPlaying()
	{
		char mcidata[MAX_PATH]; // Data is returned by some MCI requests
		char shortBuffer[MAX_PATH];
		char command[256] = {'\0'};

		GetShortPathNameA(FileName, shortBuffer, sizeof(shortBuffer) );
		sprintf(command, "status %s mode", FileName);		
		mciSendString(command,mcidata,MAX_PATH,NULL);
		return stricmp(mcidata,"playing");
	}

	public: void CloseMusic(void)
	{
		char shortBuffer[MAX_PATH];
		char command[256] = {'\0'};

		GetShortPathNameA(FileName, shortBuffer, sizeof(shortBuffer) );
		sprintf(command, "close %s", shortBuffer);
		mciSendString(command, 0, 0, 0);
	}
};
very cool
but the:
Code:
	public: int IsPlaying()
	{
		char mcidata[MAX_PATH]; // Data is returned by some MCI requests
		char shortBuffer[MAX_PATH];
		char command[256] = {'\0'};

		GetShortPathNameA(FileName, shortBuffer, sizeof(shortBuffer) );
		sprintf(command, "status %s mode", FileName);		
		mciSendString(command,mcidata,MAX_PATH,NULL);
		return stricmp(mcidata,"playing");
	}
and i don't know why isn't working
i can't use a loop\repeat command in mciSendString(), then i use these function for help me on repeat action
can anyone advice me?
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing? [C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
 
[C\C++ - mciSendString] - how testing if is playing?
[C\C++ - mciSendString] - how testing if is playing?
 
-->