home *** CD-ROM | disk | FTP | other *** search
/ Geek 6 / Geek-006.iso / linux / video / xmovie-1.5.3.tar.gz / xmovie-1.5.3.tar / xmovie-1.5.3 / xmovie / playlist.C < prev    next >
C/C++ Source or Header  |  2000-11-29  |  969b  |  82 lines

  1. #include "playlist.h"
  2.  
  3. #include <stdio.h>
  4. #include <string.h>
  5.  
  6. PlaylistArray::PlaylistArray()
  7.  : ArrayList<char*>()
  8. {
  9. }
  10.  
  11. PlaylistArray::~PlaylistArray()
  12. {
  13. }
  14.  
  15.  
  16.  
  17. Playlist::Playlist()
  18. {
  19. }
  20.  
  21. Playlist::~Playlist()
  22. {
  23.     for(int i = 0; i < array.total; i++)
  24.     {
  25.         delete array.values[i];
  26.     }
  27. }
  28.  
  29.  
  30. int Playlist::load(char *path)
  31. {
  32.     FILE *file;
  33.     char string[1024];
  34.     char *new_string;
  35.     int i;
  36.  
  37.     if(!(file = fopen(path, "r")))
  38.     {
  39.         return 1;
  40.     }
  41.     fread(string, 8, 1, file);
  42.     string[8] = 0;
  43.     if(strncasecmp(string, "PLAYLIST", 8))
  44.     {
  45.         fclose(file);
  46.         return 1;
  47.     }
  48.  
  49.     while(!feof(file))
  50.     {
  51.         fgets(string, 1024, file);
  52.         if(string[0] == '#') continue;
  53.         
  54.         array.append(new_string = new char[strlen(string)]);
  55.         strcpy(new_string, string);
  56.     }
  57.  
  58.     fclose(file);
  59.     return 0;
  60. }
  61.  
  62. int Playlist::save(char *path)
  63. {
  64.     return 0;
  65. }
  66.  
  67.  
  68. int Playlist::append_path(char *path)
  69. {
  70.     return 0;
  71. }
  72.  
  73. int Playlist::delete_path(int path)
  74. {
  75.     return 0;
  76. }
  77.  
  78. int Playlist::swap_paths(int path1, int path2)
  79. {
  80.     return 0;
  81. }
  82.