<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>eibox/plugins/records.py</filename>
    </added>
    <added>
      <filename>public/img/list-remove.png</filename>
    </added>
    <added>
      <filename>public/img/media-playback-start.png</filename>
    </added>
    <added>
      <filename>public/img/media-playback-stop.png</filename>
    </added>
    <added>
      <filename>public/img/process-stop.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -11,7 +11,8 @@ from PyQt4 import QtCore, QtGui
 
 class EiboxSlider(QtGui.QSlider):
     def __init__(self, orientation = None, parent = None):
+        orientation = QtCore.Qt.Orientation(orientation)
         if parent == None:
           QtGui.QSlider.__init__(self, orientation)
         else:
-          QtGui.QSlider.__init__(self, orientation, parent)
\ No newline at end of file
+          QtGui.QSlider.__init__(self, orientation, parent)</diff>
      <filename>eibox/EiboxGui/EiboxSlider.py</filename>
    </modified>
    <modified>
      <diff>@@ -56,13 +56,13 @@
             // TODO : Remover as setas quando o cont&#233;udo for menor
 
             if (data.up != null &amp;&amp; self.position &gt;= 0) {
-                $(data.up).css({ opacity: '0.2'});
+                $(data.up).css({ opacity: '0'});
             } else {
                 $(data.up).css({ opacity: '1.0'});
             }
 
             if (data.down != null &amp;&amp; self.position &lt;= self.max) {
-                $(data.down).css({ opacity: '0.2'});
+                $(data.down).css({ opacity: '0'});
             } else {
                 $(data.down).css({ opacity: '1.0'});
             }</diff>
      <filename>eibox/js/jquery/jquery.touchscroll.js</filename>
    </modified>
    <modified>
      <diff>@@ -22,10 +22,10 @@ gst.StateChangeReturn.__str__ = _gst_state__str__
 
 class Player(QtCore.QThread):
     pipeline  = None;
-    playbin   = gst.element_factory_make('playbin')
+    playbin   = None;
 
     _state    = None;
-    _mutex    = QtCore.QMutex()
+    _mutex    = None;
     _duration = None;
     
     __pyqtSignals__ = (
@@ -37,12 +37,13 @@ class Player(QtCore.QThread):
         'error(int, QString)'
     )
 
-    def __init__(self, parent):
+    def __init__(self, name, parent = None):
         QtCore.QThread.__init__(self, parent)
-        self.pipeline = gst.Pipeline('podmobile')
+        self.playbin  = gst.element_factory_make('playbin')
+        self.pipeline = gst.Pipeline(name)
         self.pipeline.add(self.playbin)
         self._state = self.pipeline.get_state()[1]
-
+        self._mutex = QtCore.QMutex()
         self.start()
 
     def lock(self):</diff>
      <filename>eibox/plugins/player.py</filename>
    </modified>
    <modified>
      <diff>@@ -90,6 +90,12 @@ class EiboxWindow(QtGui.QMainWindow):
         msg = msg.toAscii()
         eval(&quot;logging.%s(msg)&quot; % str(type))
 
+    @QtCore.pyqtSignature(&quot;QString&quot;)
+    def remove_file(self, file):
+        file = str(file)
+        if (os.path.exists(file)):
+            os.remove(file)
+
     @QtCore.pyqtSignature(&quot;QString&quot;, result = &quot;QString&quot;)
     def plugin(self, params):
         params = cjson.decode(str(params.toUtf8()))</diff>
      <filename>eibox/window.py</filename>
    </modified>
    <modified>
      <diff>@@ -117,9 +117,12 @@ body.pc {
     max-width: 317px;
 }
 
-#content .numerable {
+.numerable {
     font-size: 1em;
     color: #42515B;
+}
+
+#content .numerable {
     width: 60px;
 }
 
@@ -245,13 +248,26 @@ background: transparent url(../img/icons/podcasts.png) no-repeat 15px;
     width: 340px;
     height: 100%;
     float: left;
+    background: transparent url(../img/m.png) no-repeat center;
+}
+
+#left .painel { 
+    visibility: hidden;
+}
+
+#left.showplayer {
+    background-image: none;
+}
+
+#left.showplayer .painel {
+    visibility: visible;
 }
 
 /* PLayer */
 #player {
     height: 160px;
-    margin-bottom: 5px;
     padding-top: 5px;
+    margin-bottom: 5px;
 }
 
 #player #thumb {
@@ -360,7 +376,12 @@ background: transparent url(../img/icons/podcasts.png) no-repeat 15px;
     text-align: center;
 }
 
+#commentslist {
+    clear: both;
+}
+
 #lcomments .scrollable {
+    clear: both;
     max-height: 194px;
     overflow: hidden;
     margin: 2px 0;
@@ -379,18 +400,43 @@ background: transparent url(../img/icons/podcasts.png) no-repeat 15px;
 }
 
 #lcomments ul li {
+    font-size: 14pt;
     width: 100%;
-    height: 59px;
+    height: 28px;
     border-bottom: solid 1px #FFF;
     background-color: #7993a3;
     clear: both;
+    text-align: left;
+    padding: 5px 5px 0 5px;
 }
 
+#lcomments ul li a {
+    margin: -5px 10px 0 0;
+    float: right;
+    display: block;
+    width: 32px;
+    height: 32px;
+}
+
+#lcomments ul li .play {
+    background: transparent url(../img/media-playback-start.png) no-repeat center;
+}
+
+#lcomments ul li .remove {
+    background: transparent url(../img/list-remove.png) no-repeat center;
+}
+
+/*
+#lcomments ul li label {
+    margin-left: 5px;
+}*/
+
 #lcomments ul li.select {
     background-color: #B37638
 }
 
 #lcomments h1 {
+    float: left;
     margin: 2px 0 0 5px;
     height: 21px;
     line-height: 21px;
@@ -401,6 +447,15 @@ background: transparent url(../img/icons/podcasts.png) no-repeat 15px;
     width: 100px;
 }
 
+#lcomments h2 {
+    float: right;
+    margin: 6px 10px 0 0;
+}
+
+.up .dowm {
+   opacity: 0.0; 
+}
+
 /* Dialogs */
 #dialogs div {
     display: none;
@@ -445,6 +500,3 @@ background: transparent url(../img/icons/podcasts.png) no-repeat 15px;
     left: 0;
 }
 
-.init_hide {
-    visibility: hidden;
-}</diff>
      <filename>public/css/style.css</filename>
    </modified>
    <modified>
      <diff>@@ -99,23 +99,24 @@ function podMobile($) {
 
         // List
         self.divs.list.find('li').live('click', self.item_click);
+        self.divs.lcomments.find('li').live('click', self.comment_click);
 
         $('#list &gt; .scrollable').touchscroll({
             up   : '#list .up',
             down : &quot;#list .down&quot;
         });
 
-        $('#lcomments &gt; .scrollable').touchscroll({
+        $('#lcomments .scrollable').touchscroll({
             up   : '#lcomments .up',
             down : &quot;#lcomments .down&quot;
         });
 
         self.loadList();
-        //self.init_player();
+        self.init_player();
 
         // Hidde splash
-        $('.init_hide').css('visibility', 'visible');
-        //$('#loading').fadeOut(1000);
+        //$('.init_hide').css('visibility', 'visible');
+        $('#loading').fadeOut(1000);
     }
 
     //-------------------------------------------------------------
@@ -177,10 +178,12 @@ function podMobile($) {
                         case('play'):
                             if (data.cast.download == &quot;download&quot; &amp;&amp; data.cast.local != null) {
                                 self.current_player = {
+                                    podcast_id : data.podcast.id,
                                     podcast : data.padcast,
                                     cast    : data.cast,
                                     podcast_line : data.podcast_line,
-                                    cast_line    : list
+                                    cast_line    : list,
+                                    cont   : false,
                                 };
 
                                 self.divs.player.find('h1').html(data.podcast.title);
@@ -188,6 +191,8 @@ function podMobile($) {
                                 self.divs.thumb.attr('src', data.podcast.img);
                                 self.player.setCurrentSource(data.cast.local);
                             }
+                            self.load_comments();
+                            self.show_play();
                             self.player.play();
                             self.reloadCurrentContent();
                             return;
@@ -502,11 +507,70 @@ function podMobile($) {
         return &quot;%s%s%s%s%s&quot;.sprintf(d[0], d[1], d[2], d[3], d[4]);
     }
 
+    self.show_play = function() {
+        $('#left').addClass('showplayer');
+    }
+
+    self.comment_click = function(event) {
+        if (event.toElement.nodeName == &quot;A&quot;) {
+            var data = $(this).data('comment');
+            var link = $(event.toElement);
+            if (link.hasClass('play')) {
+                if (self.player.state() == 'GST_STATE_PLAYING') {
+                    self.player.pause();
+                    self.current_player.cont = true;
+                }
+
+                if (self.player2.state() == 'GST_STATE_PLAYING') {
+                    link.css(&quot;background-image&quot;, &quot;url(img/media-playback-start.png)&quot;);
+                    self.player2.stop();
+                    if (self.current_player.cont) {
+                        self.player.play();
+                    }
+                    self.current_player.cont = false;
+                } else {
+                    link.css(&quot;background-image&quot;, &quot;url(img/media-playback-stop.png)&quot;)
+                    Eibox.logging.debug(data.file);
+                    self.player2.setCurrentSource(data.file);
+                    self.player2.start();
+                    self.player2.finished.connect(function() {
+                        link.css(&quot;background-image&quot;, &quot;url(img/media-playback-start.png)&quot;);
+                        self.player2.stop();
+                        if (self.current_player.cont) {
+                            self.player.play();
+                        }
+                        self.current_player.cont = false;
+                    });
+                }
+            } else if(link.hasClass('remove')) {
+                data.destroy();
+                self.load_comments();
+            }
+        }
+    }
+
+    self.load_comments = function() {
+        if (!Eibox.empty(self.current_player)) {
+            var list = self.divs.lcomments.find('ul');
+            list.html(&quot;&quot;);
+            comments = Comment.find({ conditions : 'cast_id = ' + self.current_player.cast.id });
+            self.divs.lcomments.find('h2').html(comments.length);
+            $(comments).each(function() {
+               var label = (convertTime(this.position) + ' - ' + convertTime(this.duration))
+               var item  = $('&lt;li&gt;&lt;label&gt;' + label + '&lt;/label&gt;&lt;a class=&quot;remove&quot; href=&quot;#&quot;/&gt;&lt;/a&gt;&lt;a class=&quot;play&quot; href=&quot;#&quot;/&gt;&lt;/a&gt;&lt;/li&gt;');
+               list.append(item);
+               item.data('comment', this);
+            });
+        }
+    };
+
     /**
      * Initialize player
      */
     self.init_player = function() {
-        self.player = Eibox.plugin(&quot;Player&quot;);
+        self.player  = Eibox.plugin(&quot;Player&quot;, &quot;player&quot;);
+        self.player2  = Eibox.plugin(&quot;Player&quot;, &quot;comment&quot;);
+        self.records = Eibox.plugin(&quot;Records&quot;);
         //self.player.start();
 
         // Slider
@@ -522,6 +586,38 @@ function podMobile($) {
             (self.player.state() == 'GST_STATE_PLAYING') ? self.player.pause() : self.player.play();
         });
 
+        self.records.finished.connect(function(duration, position, file, cont) {
+            var c = Comment.create({
+                cast_id  : self.current_player.cast.id,
+                duration : duration,
+                position : position,
+                file     : file
+            });
+            if (cont)
+                self.player.play();
+            
+            self.load_comments();
+        });
+
+        // Comments
+        $('#bt_comment').click(function() {
+            if (!Eibox.empty(self.current_player)) {
+                if (self.records.state == 'NULL') {
+                    var playing = false;
+                    if (self.player.state() == 'GST_STATE_PLAYING') {
+                        self.player.pause();
+                        playing = true;
+                    }
+                    var file = self.info.home_dir + self.current_player.podcast_id + '/comment_' + ((new Date()).getTime()) + '.ogg'
+                    self.records.record(file, slider.value, playing);
+                    $(this).css(&quot;background-image&quot;, &quot;url(img/bt_stop.png)&quot;);
+                } else {
+                    self.records.stop();
+                    $(this).css(&quot;background-image&quot;, &quot;url(img/bt_comment.png)&quot;);
+                }
+            }
+        });
+
         self.player.totalTimeChanged.connect(function(duration) {
             slider.value = 0;
             setDurationBox(0, duration);</diff>
      <filename>public/js/main.js</filename>
    </modified>
    <modified>
      <diff>@@ -116,3 +116,21 @@ var Cast = new JazzRecord.Model({
     }
   }
 });
+
+var Comment = new JazzRecord.Model({
+    table: &quot;comments&quot;,
+    //belongsTo: { cast: &quot;casts&quot;},
+    columns: {
+        cast_id  : &quot;number&quot;,
+        duration : &quot;number&quot;,
+        position : &quot;number&quot;,
+        file     : &quot;text&quot;
+    },
+
+    events: {
+        onDestroy: function() {
+            application.remove_file(this.file);
+            //Eibox.pyEval('if (os.path.exists(&quot;' + this.file + '&quot;)): os.remove(self.saveFileName)');
+        }
+    }
+});</diff>
      <filename>public/js/models.js</filename>
    </modified>
    <modified>
      <diff>@@ -42,37 +42,47 @@
             &lt;/div&gt;
             &lt;div id=&quot;left&quot;&gt;
                 &lt;div id=&quot;player&quot; class=&quot;painel&quot;&gt;
-                    &lt;img id=&quot;thumb&quot; src=&quot;img/default.png&quot; /&gt;
-                    &lt;h1&gt;Podmobile&lt;/h1&gt;
-                    &lt;h2&gt;&lt;/h2&gt;
-                    &lt;a id=&quot;volume&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
-                    &lt;div id=&quot;controller&quot;&gt;
-                        &lt;a id=&quot;bt_player&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
-                        &lt;a id=&quot;bt_comment&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
-                        &lt;a id=&quot;bt_back&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
-                        &lt;a id=&quot;duration&quot; href=&quot;#&quot;&gt;Not load&lt;/a&gt;
-                        &lt;a id=&quot;bt_forward&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
-                    &lt;/div&gt;
-                    &lt;div id=&quot;progress&quot;&gt;
-                        &lt;div class=&quot;slider init_hide&quot;&gt;
-                            &lt;object type=&quot;application/x-qt-plugin&quot; classid=&quot;EiboxGui.EiboxSlider&quot; name=&quot;slider&quot; height=&quot;15&quot; width=&quot;220&quot;&gt;
-                                &lt;param name=&quot;init&quot; value=&quot;1, parent&quot; /&gt;
-                            &lt;/object&gt;
+                    &lt;div id=&quot;playercontent&quot;&gt;
+                        &lt;img id=&quot;thumb&quot; src=&quot;img/default.png&quot; /&gt;
+                        &lt;h1&gt;Podmobile&lt;/h1&gt;
+                        &lt;h2&gt;&lt;/h2&gt;
+                        &lt;!--
+                        &lt;a id=&quot;volume&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                        --&gt;
+                        &lt;div id=&quot;controller&quot;&gt;
+                            &lt;a id=&quot;bt_player&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                            &lt;a id=&quot;bt_comment&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                            &lt;a id=&quot;bt_back&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                            &lt;a id=&quot;duration&quot; href=&quot;#&quot;&gt;Not load&lt;/a&gt;
+                            &lt;a id=&quot;bt_forward&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                        &lt;/div&gt;
+                        &lt;div id=&quot;progress&quot;&gt;
+                            &lt;div class=&quot;slider init_hide&quot;&gt;
+                                &lt;object type=&quot;application/x-qt-plugin&quot; classid=&quot;EiboxGui.EiboxSlider&quot; name=&quot;slider&quot; height=&quot;15&quot; width=&quot;220&quot;&gt;
+                                    &lt;param name=&quot;init&quot; value=&quot;1, parent&quot; /&gt;
+                                &lt;/object&gt;
+                            &lt;/div&gt;
                         &lt;/div&gt;
                     &lt;/div&gt;
                 &lt;/div&gt;
                 &lt;div id=&quot;lcomments&quot; class=&quot;painel&quot;&gt;
                     &lt;h1&gt;Comments&lt;/h1&gt;
-                    &lt;img class=&quot;up&quot; src=&quot;img/arrow_up.png&quot; /&gt;
-                    &lt;div class=&quot;scrollable&quot;&gt;
-                        &lt;ul&gt;
-                            &lt;li&gt;Item 1&lt;/li&gt;
-                            &lt;li&gt;Item 1&lt;/li&gt;
-                            &lt;li&gt;Item 1&lt;/li&gt;
-                            &lt;li&gt;Item 1&lt;/li&gt;
-                        &lt;/ul&gt;
+                    &lt;h2 class=&quot;numerable&quot;&gt;0&lt;/h2&gt;
+                    &lt;div id=&quot;commentslist&quot;&gt;
+                        &lt;img class=&quot;up&quot; src=&quot;img/arrow_up.png&quot; /&gt;
+                        &lt;div class=&quot;scrollable&quot;&gt;
+                            &lt;ul&gt;
+                                &lt;!--
+                                &lt;li&gt;
+                                    &lt;label&gt;0:01:12 - 0:10&lt;/label&gt;
+                                    &lt;a class=&quot;remove&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                                    &lt;a class=&quot;play&quot; href=&quot;#&quot;&gt;&lt;/a&gt;
+                                &lt;/li&gt;
+                                --&gt;
+                            &lt;/ul&gt;
+                        &lt;/div&gt;
+                        &lt;img class=&quot;down&quot; src=&quot;img/arrow_down.png&quot; /&gt;
                     &lt;/div&gt;
-                    &lt;img class=&quot;down&quot; src=&quot;img/arrow_down.png&quot; /&gt;
                 &lt;/div&gt;
             &lt;/div&gt;
         &lt;/div&gt;
@@ -85,9 +95,7 @@
             &lt;/div&gt;
             &lt;h2 id=&quot;msg&quot;&gt;&lt;/h2&gt;
         &lt;/div&gt;
-        &lt;!--
         &lt;div id=&quot;loading&quot;&gt;&lt;/div&gt;
-        --&gt;
     &lt;/body&gt;
 &lt;/html&gt;
 </diff>
      <filename>public/main.html</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>1172f183dd389a83da72b856c8e8b5e860220aff</id>
    </parent>
  </parents>
  <author>
    <name>Everton Ribeiro</name>
    <email>nuxlli@gmail.com</email>
  </author>
  <url>http://github.com/nuxlli/podmobile/commit/eae529a724a31b95f73d54a7033b241962e0ccff</url>
  <id>eae529a724a31b95f73d54a7033b241962e0ccff</id>
  <committed-date>2009-02-12T02:42:04-08:00</committed-date>
  <authored-date>2009-02-12T02:42:04-08:00</authored-date>
  <message>Suporte a grava&#231;&#227;o de audio</message>
  <tree>001efd4e1abe7af43e6a309c81dab51ff9cb83f9</tree>
  <committer>
    <name>Everton Ribeiro</name>
    <email>nuxlli@gmail.com</email>
  </committer>
</commit>
