~ubuntu-branches/ubuntu/precise/guayadeque/precise

« back to all changes in this revision

Viewing changes to src/.svn/text-base/PlayListFile.h.svn-base

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-05-14 15:08:03 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110514150803-8b5evqetnaj35j34
Tags: 0.3.1~dfsg0-1
* New upstream release.
* Strip wxsqlite3 stuff out of upstream's tarballs.
* Update get-orig-source target in debian/rules.
* Update gbp config file.
* Bump Standards.
* Build-depend on libwxsqlite3-2.8-dev
* Enable parallel builds.
* Link binaries against the system-wide copy of wxsqlite3.
* Point sources to the correct wxcurl's headers location.
* Update copyright file as per DEP-5
* Improve debian/watch to handle the ~dfsg\d* suffix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// -------------------------------------------------------------------------------- //
2
 
//      Copyright (C) 2008-2010 J.Rios
3
 
//      anonbeat@gmail.com
4
 
//
5
 
//    This Program 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, or (at your option)
8
 
//    any later version.
9
 
//
10
 
//    This Program 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 this program; see the file LICENSE.  If not, write to
17
 
//    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
//    http://www.gnu.org/copyleft/gpl.html
19
 
//
20
 
// -------------------------------------------------------------------------------- //
21
 
#ifndef PLAYLISTFILE_H
22
 
#define PLAYLISTFILE_H
23
 
 
24
 
#include <wx/arrstr.h>
25
 
#include <wx/dynarray.h>
26
 
#include <wx/string.h>
27
 
#include <wx/xml/xml.h>
28
 
 
29
 
class guStationPlayListItem
30
 
{
31
 
  public:
32
 
    wxString m_Name;
33
 
    wxString m_Location;
34
 
 
35
 
    guStationPlayListItem() {};
36
 
 
37
 
    guStationPlayListItem( const wxString &location, const wxString &title )
38
 
    {
39
 
        m_Name = title;
40
 
        m_Location = location;
41
 
    }
42
 
};
43
 
WX_DECLARE_OBJARRAY(guStationPlayListItem, guStationPlayList);
44
 
 
45
 
// -------------------------------------------------------------------------------- //
46
 
class guPlayListFile
47
 
{
48
 
  private :
49
 
    void                ReadXspfPlayList( wxXmlNode * XmlNode );
50
 
    void                ReadXspfTrackList( wxXmlNode * XmlNode );
51
 
    void                ReadXspfTrack( wxXmlNode * XmlNode );
52
 
 
53
 
    void                ReadAsxEntry( wxXmlNode * XmlNode );
54
 
    void                ReadAsxPlayList( wxXmlNode * XmlNode );
55
 
 
56
 
  protected :
57
 
    wxString            m_Name;
58
 
    guStationPlayList   m_PlayList;
59
 
 
60
 
    bool                ReadPlsStream( wxInputStream &playlist, const wxString &path = wxEmptyString );
61
 
    bool                ReadM3uStream( wxInputStream &playlist, const wxString &path = wxEmptyString );
62
 
    bool                ReadXspfStream( wxInputStream &playlist );
63
 
    bool                ReadAsxStream( wxInputStream &playlist );
64
 
 
65
 
    bool                ReadPlsFile( const wxString &filename );
66
 
    bool                ReadM3uFile( const wxString &filename );
67
 
    bool                ReadXspfFile( const wxString &filename );
68
 
    bool                ReadAsxFile( const wxString &filename );
69
 
 
70
 
    bool                WritePlsFile( const wxString &filename );
71
 
    bool                WriteM3uFile( const wxString &filename );
72
 
    bool                WriteXspfFile( const wxString &filename );
73
 
    bool                WriteAsxFile( const wxString &filename );
74
 
 
75
 
  public :
76
 
    guPlayListFile( void ) {};
77
 
    guPlayListFile( const wxString &uri );
78
 
    ~guPlayListFile();
79
 
 
80
 
    bool                    Load( const wxString &uri );
81
 
    bool                    Save( const wxString &filename );
82
 
 
83
 
    wxString                GetName( void ) { return m_Name; };
84
 
    void                    SetName( const wxString &name ) { m_Name = name; };
85
 
    guStationPlayList       GetPlayList( void ) { return m_PlayList; };
86
 
    void                    SetPlayList( const guStationPlayList &playlist ) { m_PlayList = playlist; };
87
 
 
88
 
    size_t                  Count( void ) const { return m_PlayList.Count(); };
89
 
 
90
 
    guStationPlayListItem   GetItem( const size_t index )
91
 
    {
92
 
        return m_PlayList[ index ];
93
 
    }
94
 
 
95
 
    void                    AddItem( const wxString &location, const wxString &title = wxEmptyString )
96
 
    {
97
 
        m_PlayList.Add( new guStationPlayListItem( location, title ) );
98
 
    }
99
 
 
100
 
    void                    AddItem( const guStationPlayListItem &item )
101
 
    {
102
 
        m_PlayList.Add( new guStationPlayListItem( item ) );
103
 
    };
104
 
 
105
 
    static bool             IsValidPlayList( const wxString &uri );
106
 
 
107
 
};
108
 
 
109
 
 
110
 
#endif
111
 
// -------------------------------------------------------------------------------- //