-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlaylistTest_2.cpp
65 lines (54 loc) · 1.95 KB
/
PlaylistTest_2.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//---------------------------------------------------------------------------
#include <iostream>
#include <vcl.h>
#include "ConcretePlaylistFacade.h"
#include "PlaylistFacade.h"
#include "../Song/SongFacade.h"
#include "../Song/ConcreteSongFacade.h"
#include "../Song/SongProperty.h"
#include "../Song/FileManager.h"
#include "../Song/SongManager.h"
#include "../ImportExport/ImportExportFacade.h"
#include "../ImportExport/ConcreteImportExportFacade.h"
#include "../Player/ConcretePlayerFacade.h"
#include "../Player/PlayerFacade.h"
#include "../MediatorInterface.h"
#include "../Mediator.h"
#include "../lib/Exceptions.h"
#pragma argsused
int main(int argc, char* argv[])
{
// initialisering...
MediatorInterface *mediator = new Mediator();
SongFacade *song = new ConcreteSongFacade(mediator);
PlaylistFacade *playlist = new ConcretePlaylistFacade(mediator);
ImportExportFacade *importexport = new ConcreteImportExportFacade();
PlayerFacade *player = new ConcretePlayerFacade();
((Mediator*)mediator)->setSongFacade(song);
((Mediator*)mediator)->setPlaylistFacade(playlist);
((Mediator*)mediator)->setImportExportFacade(importexport);
((Mediator*)mediator)->setPlayerFacade(player);
player->setPlayer("Winamp2", "C:\\Program Files\\Winamp\\Winamp.exe");
// ----
song->updatePath("e:\\mp3test");
playlist->newSimplePlaylist("alfa");
SongProperty sp;
sp.addProperty("lead artist", "neWs*");
playlist->newSmartPlaylist("beta", sp);
playlist->addSongToPlaylist(1, "alfa");
playlist->addSongToPlaylist(3, "alfa");
playlist->addSongToPlaylist(5, "alfa");
playlist->addSongToPlaylist(14, "alfa");
playlist->playPlaylist("beta");
// upprensning...
delete mediator;
delete song;
delete playlist;
delete importexport;
delete player;
cout << "klart!\n";
char c;
cin >> c;
return 0;
}
//---------------------------------------------------------------------------