MediaFilePlayer: use BString for fName attribute
This commit is contained in:
@@ -61,13 +61,12 @@ PlayMediaFile(const char* media_type, const char* media_name)
|
|||||||
MediaFilePlayer::MediaFilePlayer(const char* media_type,
|
MediaFilePlayer::MediaFilePlayer(const char* media_type,
|
||||||
const char* media_name, entry_ref* ref)
|
const char* media_name, entry_ref* ref)
|
||||||
:
|
:
|
||||||
|
fName(media_name),
|
||||||
fInitCheck(B_ERROR),
|
fInitCheck(B_ERROR),
|
||||||
fRef(*ref),
|
fRef(*ref),
|
||||||
fSoundPlayer(NULL),
|
fSoundPlayer(NULL),
|
||||||
fPlayTrack(NULL)
|
fPlayTrack(NULL)
|
||||||
{
|
{
|
||||||
fName = strdup(media_name);
|
|
||||||
|
|
||||||
fPlayFile = new BMediaFile(&fRef);
|
fPlayFile = new BMediaFile(&fRef);
|
||||||
fInitCheck = fPlayFile->InitCheck();
|
fInitCheck = fPlayFile->InitCheck();
|
||||||
if (fInitCheck != B_OK)
|
if (fInitCheck != B_OK)
|
||||||
@@ -111,7 +110,6 @@ MediaFilePlayer::~MediaFilePlayer()
|
|||||||
{
|
{
|
||||||
delete fSoundPlayer;
|
delete fSoundPlayer;
|
||||||
delete fPlayFile;
|
delete fPlayFile;
|
||||||
free(fName);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <MediaFile.h>
|
#include <MediaFile.h>
|
||||||
#include <MediaTrack.h>
|
#include <MediaTrack.h>
|
||||||
#include <SoundPlayer.h>
|
#include <SoundPlayer.h>
|
||||||
|
#include <String.h>
|
||||||
|
|
||||||
|
|
||||||
void PlayMediaFile(const char* media_type, const char* media_name);
|
void PlayMediaFile(const char* media_type, const char* media_name);
|
||||||
@@ -38,7 +39,7 @@ public:
|
|||||||
const media_raw_audio_format& format);
|
const media_raw_audio_format& format);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
char* fName;
|
BString fName;
|
||||||
status_t fInitCheck;
|
status_t fInitCheck;
|
||||||
entry_ref fRef;
|
entry_ref fRef;
|
||||||
BSoundPlayer* fSoundPlayer;
|
BSoundPlayer* fSoundPlayer;
|
||||||
|
|||||||
Reference in New Issue
Block a user