Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
445
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.67 KB | None | 0 0
  1. /* smplayer, GUI front-end for mplayer.
  2. Copyright (C) 2006-2010 Ricardo Villalba <rvm@escomposlinux.org>
  3.  
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2 of the License, or
  7. (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18.  
  19. #include "mediadata.h"
  20. #include <QFileInfo>
  21. #include <cmath>
  22.  
  23. #include "preferences.h"
  24. #include "global.h"
  25. using namespace Global;
  26.  
  27. MediaData::MediaData() {
  28. reset();
  29. }
  30.  
  31. MediaData::~MediaData() {
  32. }
  33.  
  34. void MediaData::reset() {
  35. filename="";
  36. dvd_id="";
  37. type = TYPE_UNKNOWN;
  38. duration=0;
  39.  
  40. novideo = FALSE;
  41.  
  42. video_width=0;
  43. video_height=0;
  44. video_aspect= (double) 4/3;
  45.  
  46. #if PROGRAM_SWITCH
  47. programs.clear();
  48. #endif
  49. videos.clear();
  50. audios.clear();
  51. titles.clear();
  52.  
  53. subs.clear();
  54.  
  55. #if GENERIC_CHAPTER_SUPPORT
  56. chapters = 0;
  57. #else
  58. //chapters=0;
  59. //angles=0;
  60.  
  61. mkv_chapters=0;
  62. #endif
  63.  
  64. initialized=false;
  65.  
  66. // Clip info;
  67. clip_name = "";
  68. clip_artist = "";
  69. clip_author = "";
  70. clip_album = "";
  71. clip_genre = "";
  72. clip_date = "";
  73. clip_track = "";
  74. clip_copyright = "";
  75. clip_comment = "";
  76. clip_software = "";
  77.  
  78. stream_title = "";
  79. stream_url = "";
  80.  
  81. // Other data
  82. demuxer="";
  83. video_format="";
  84. audio_format="";
  85. video_bitrate=0;
  86. video_fps="";
  87. audio_bitrate=0;
  88. audio_rate=0;
  89. audio_nch=0;
  90. video_codec="";
  91. audio_codec="";
  92. }
  93.  
  94. QString MediaData::displayName() {
  95. if (pref->show_tag_in_title) {
  96. if (!clip_name.isEmpty()) return clip_name;
  97. else
  98. if (!stream_title.isEmpty()) return stream_title;
  99. }
  100.  
  101. QFileInfo fi(filename);
  102. if (fi.exists())
  103. return fi.fileName(); // filename without path
  104. else
  105. return filename;
  106. }
  107.  
  108.  
  109. void MediaData::list() {
  110. qDebug("MediaData::list");
  111.  
  112. qDebug(" filename: '%s'", filename.toUtf8().data());
  113. qDebug(" duration: %f", duration);
  114.  
  115. qDebug(" video_width: %d", video_width);
  116. qDebug(" video_height: %d", video_height);
  117. qDebug(" video_aspect: %f", video_aspect);
  118.  
  119. qDebug(" type: %d", type);
  120. qDebug(" novideo: %d", novideo);
  121. qDebug(" dvd_id: '%s'", dvd_id.toUtf8().data());
  122.  
  123. qDebug(" initialized: %d", initialized);
  124.  
  125. #if GENERIC_CHAPTER_SUPPORT
  126. qDebug(" chapters: %d", chapters);
  127. #else
  128. qDebug(" mkv_chapters: %d", mkv_chapters);
  129. #endif
  130.  
  131. qDebug(" Subs:");
  132. subs.list();
  133.  
  134. #if PROGRAM_SWITCH
  135. qDebug(" Programs:");
  136. programs.list();
  137. #endif
  138. qDebug(" Videos:");
  139. videos.list();
  140.  
  141. qDebug(" Audios:");
  142. audios.list();
  143.  
  144. qDebug(" Titles:");
  145. titles.list();
  146.  
  147. //qDebug(" chapters: %d", chapters);
  148. //qDebug(" angles: %d", angles);
  149.  
  150. qDebug(" demuxer: '%s'", demuxer.toUtf8().data() );
  151. qDebug(" video_format: '%s'", video_format.toUtf8().data() );
  152. qDebug(" audio_format: '%s'", audio_format.toUtf8().data() );
  153. qDebug(" video_bitrate: %d", video_bitrate );
  154. qDebug(" video_fps: '%s'", video_fps.toUtf8().data() );
  155. qDebug(" audio_bitrate: %d", audio_bitrate );
  156. qDebug(" audio_rate: %d", audio_rate );
  157. qDebug(" audio_nch: %d", audio_nch );
  158. qDebug(" video_codec: '%s'", video_codec.toUtf8().data() );
  159. qDebug(" audio_codec: '%s'", audio_codec.toUtf8().data() );
  160. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement