aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Input/in_wmvdrm/WMPlaylist.cpp
blob: 7f1d6a20258e2a7ef0b4605eb8bacc77e71afd04 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "main.h"
#include "WMPlaylist.h"

WMPlaylist activePlaylist;

void WMPlaylist::OnFile( const wchar_t *filename, const wchar_t *title, int lengthInMS, ifc_plentryinfo *info )
{
	//if (playstring.empty())
	if ( playstring )
		free( playstring );

	playstring = _wcsdup( filename );
}

const wchar_t *WMPlaylist::GetFileName()
{
	return ( playstring ? playstring : L"" );
}

const wchar_t *WMPlaylist::GetOriginalFileName()
{
	return ( playlistFilename ? playlistFilename : L"" );
}

bool WMPlaylist::IsMe( const char *filename )
{
	return IsMe( (const wchar_t *)AutoWide( filename ) );
}

bool WMPlaylist::IsMe( const wchar_t *filename )
{
	if ( playlistFilename && !_wcsicmp( playlistFilename, filename ) )
		return true;

	if ( playstring && !_wcsicmp( playstring, filename ) )
		return true;

	return false;
}

#define CBCLASS WMPlaylist
START_DISPATCH;
VCB( IFC_PLAYLISTLOADERCALLBACK_ONFILE, OnFile )
END_DISPATCH;
#undef CBCLASS