Author: jbevain
Date: 2007-09-20 10:56:27 -0400 (Thu, 20 Sep 2007)
New Revision: 86064
Modified:
trunk/moon/src/playlist.cpp
trunk/moon/src/playlist.h
Log:
move boring code (accessors) from playlist.cpp to playlist.h
Modified: trunk/moon/src/playlist.cpp
===================================================================
--- trunk/moon/src/playlist.cpp 2007-09-20 14:51:58 UTC (rev 86063)
+++ trunk/moon/src/playlist.cpp 2007-09-20 14:56:27 UTC (rev 86064)
@@ -1,5 +1,5 @@
/*
- * playlist.cpp:
+ * playlist.cpp:
*
* Author: Jb Evain <[EMAIL PROTECTED]>
*
@@ -17,146 +17,6 @@
#include "downloader.h"
#include "xaml.h"
-// PlaylistContent
-
-PlaylistContent::PlaylistContent ()
-{
- base = NULL;
- title = NULL;
- author = NULL;
- abstract = NULL;
-}
-
-PlaylistContent::~PlaylistContent ()
-{
- g_free (base);
- g_free (title);
- g_free (author);
- g_free (abstract);
-}
-
-const char *
-PlaylistContent::GetBase ()
-{
- return base;
-}
-
-void
-PlaylistContent::SetBase (char *base)
-{
- this->base = base;
-}
-
-const char *
-PlaylistContent::GetTitle ()
-{
- return title;
-}
-
-void
-PlaylistContent::SetTitle (char *title)
-{
- this->title = title;
-}
-
-const char *
-PlaylistContent::GetAuthor ()
-{
- return author;
-}
-
-void
-PlaylistContent::SetAuthor (char *author)
-{
- this->author = author;
-}
-
-const char *
-PlaylistContent::GetAbstract ()
-{
- return abstract;
-}
-
-void
-PlaylistContent::SetAbstract (char *abstract)
-{
- this->abstract = abstract;
-}
-
-const char *
-PlaylistContent::GetCopyright ()
-{
- return copyright;
-}
-
-void
-PlaylistContent::SetCopyright (char *copyright)
-{
- this->copyright = copyright;
-}
-
-// PlaylistEntry
-
-PlaylistEntry::PlaylistEntry ()
-{
- source = NULL;
- start_time = 0;
-}
-
-PlaylistEntry::~PlaylistEntry ()
-{
- delete source;
- g_free (source_name);
-}
-
-const char *
-PlaylistEntry::GetSourceName ()
-{
- return source_name;
-}
-
-void
-PlaylistEntry::SetSourceName (char *source_name)
-{
- this->source_name = source_name;
-}
-
-gint64
-PlaylistEntry::GetStartTime ()
-{
- return start_time;
-}
-
-void
-PlaylistEntry::SetStartTime (gint64 start_time)
-{
- this->start_time = start_time;
-}
-
-gint64
-PlaylistEntry::GetDuration ()
-{
- return duration;
-}
-
-void
-PlaylistEntry::SetDuration (gint64 duration)
-{
- this->duration = duration;
-}
-
-MediaSource *
-PlaylistEntry::GetSource ()
-{
- return source;
-}
-
-void
-PlaylistEntry::SetSource (MediaSource *source)
-{
- this->source = source;
-}
-
// Playlist
Playlist::Playlist (MediaElement *element, const char *source_name, const char
*file_name)
Modified: trunk/moon/src/playlist.h
===================================================================
--- trunk/moon/src/playlist.h 2007-09-20 14:51:58 UTC (rev 86063)
+++ trunk/moon/src/playlist.h 2007-09-20 14:56:27 UTC (rev 86064)
@@ -1,5 +1,5 @@
/*
- * playlist.h:
+ * playlist.h:
*
* Author: Jb Evain <[EMAIL PROTECTED]>
*
@@ -24,23 +24,67 @@
char *abstract;
char *copyright;
public:
- PlaylistContent ();
- ~PlaylistContent ();
+ PlaylistContent () : base (NULL), title (NULL), author (NULL), abstract
(NULL), copyright (NULL)
+ {
+ }
- const char *GetBase ();
- void SetBase (char *base);
+ ~PlaylistContent ()
+ {
+ g_free (base);
+ g_free (title);
+ g_free (author);
+ g_free (abstract);
+ }
- const char *GetTitle ();
- void SetTitle (char *title);
+ const char *GetBase ()
+ {
+ return base;
+ }
- const char *GetAuthor ();
- void SetAuthor (char *author);
+ void SetBase (char *base)
+ {
+ this->base = base;
+ }
- const char *GetAbstract ();
- void SetAbstract (char *abstract);
+ const char *GetTitle ()
+ {
+ return title;
+ }
- const char *GetCopyright ();
- void SetCopyright (char *copyright);
+ void SetTitle (char *title)
+ {
+ this->title = title;
+ }
+
+ const char *GetAuthor ()
+ {
+ return author;
+ }
+
+ void SetAuthor (char *author)
+ {
+ this->author = author;
+ }
+
+ const char *GetAbstract ()
+ {
+ return abstract;
+ }
+
+ void SetAbstract (char *abstract)
+ {
+ this->abstract = abstract;
+ }
+
+ const char *GetCopyright ()
+ {
+ return copyright;
+ }
+
+ void SetCopyright (char *copyright)
+ {
+ this->copyright = copyright;
+ }
};
class PlaylistEntry : public List::Node, public PlaylistContent {
@@ -50,20 +94,55 @@
gint64 duration;
MediaSource *source;
public:
- PlaylistEntry ();
- ~PlaylistEntry ();
+ PlaylistEntry () : source_name (NULL), start_time (0), duration (0),
source (NULL)
+ {
+ }
- const char *GetSourceName ();
- void SetSourceName (char *file);
+ ~PlaylistEntry ()
+ {
+ delete source;
+ g_free (source_name);
+ }
- gint64 GetStartTime ();
- void SetStartTime (gint64 start_time);
+ const char *GetSourceName ()
+ {
+ return source_name;
+ }
- gint64 GetDuration ();
- void SetDuration (gint64 duration);
+ void SetSourceName (char *source_name)
+ {
+ this->source_name = source_name;
+ }
- MediaSource *GetSource ();
- void SetSource (MediaSource *source);
+ gint64 GetStartTime ()
+ {
+ return start_time;
+ }
+
+ void SetStartTime (gint64 start_time)
+ {
+ this->start_time = start_time;
+ }
+
+ gint64 GetDuration ()
+ {
+ return duration;
+ }
+
+ void SetDuration (gint64 duration)
+ {
+ this->duration = duration;
+ }
+
+ MediaSource *GetSource ()
+ {
+ return source;
+ }
+
+ void SetSource (MediaSource *source)
+ {
+ this->source = source;
+ }
};
class Playlist : public MediaSource, public PlaylistContent {
@@ -121,7 +200,7 @@
class KindNode : public List::Node {
public:
PlaylistNodeKind kind;
-
+
KindNode (PlaylistNodeKind kind)
{
this->kind = kind;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches