Added playlist actions (insert, delete, move up, move down), with only insert working...
[kworship.git] / kworship / playlist / KwPlaylistVideo.cpp
blobfe5d59d065021eb475d2ad6a2b74ed98ed5025b1
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 /**
21 * @file KwPlaylistVideo.h
22 * @brief An video playlist item.
23 * @author James Hogan <james@albanarts.com>
26 #include "KwPlaylistVideo.h"
27 #include "KwDisplayManager.h"
29 KW_REGISTER_PLAYLIST_ITEM(KwPlaylistVideo, "video")
32 * Constructors + destructor.
35 /// Default constructor.
36 KwPlaylistVideo::KwPlaylistVideo(const QUrl& url)
37 : KwPlaylistFile(url)
38 , m_mediaItem(url)
40 m_mediaItem.setAudio(true);
41 m_mediaItem.setVideo(true);
44 /// Construct from a DOM element.
45 KwPlaylistVideo::KwPlaylistVideo(const QDomElement& element, KwResourceManager* resourceManager)
46 : KwPlaylistFile(element, resourceManager)
47 , m_mediaItem(getUrl())
49 m_mediaItem.setAudio(true);
50 m_mediaItem.setVideo(true);
53 /// Destructor.
54 KwPlaylistVideo::~KwPlaylistVideo()
59 * DOM Translation.
62 QString KwPlaylistVideo::itemType() const
64 return "video";
67 void KwPlaylistVideo::exportDetailsToDom(QDomDocument& document, QDomElement& element, KwResourceManager* resourceManager) const
69 KwPlaylistFile::exportDetailsToDom(document, element, resourceManager);
73 * Main interface.
76 void KwPlaylistVideo::activate(KwDisplayManager* manager)
78 manager->background.setVideo();
79 manager->text.clear();
80 m_mediaItem.playMedia(manager->getMediaManager());