Synchronize with trunk
authorRichard Kettlewell <rjk@greenend.org.uk>
Fri, 27 Nov 2009 19:28:53 +0000 (19:28 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Fri, 27 Nov 2009 19:28:53 +0000 (19:28 +0000)
CHANGES.html
disobedience/manual/index.html
disobedience/manual/intro.html
disobedience/manual/playlist-create.png [new file with mode: 0644]
disobedience/manual/playlist-picker-menu.png [new file with mode: 0644]
disobedience/manual/playlist-popup-menu.png [new file with mode: 0644]
disobedience/manual/playlist-window.png [new file with mode: 0644]
disobedience/manual/playlists.html
disobedience/playlists.c
lib/resample.c
server/normalize.c

index c227646..b9ed4e3 100644 (file)
@@ -163,6 +163,11 @@ span.command {
         </tr>
 
         <tr>
+          <td><a href="http://code.google.com/p/disorder/issues/detail?id=32">#32</a></d>
+          <td>Excessively verbose log chatter on shutdown</td>
+        </tr>
+
+        <tr>
           <td><a href="http://code.google.com/p/disorder/issues/detail?id=33">#33</a></d>
           <td>(Some) plugins need -lm.</td>
         </tr>
index a453bdd..7245024 100644 (file)
@@ -31,15 +31,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
    <p class=chapter><a href="intro.html">1. Introduction</a></p>
    <ul>
-     <li>What DisOrder and Disobedience are, and how to get them.</li>
-     <li>How to get a DisOrder login.</li>
-     <li>How to start Disobedience.</li>
+     <li>What DisOrder and Disobedience are, and how to get them</li>
+     <li>How to get a DisOrder login</li>
+     <li>How to start Disobedience</li>
    </ul>
 
    <p class=chapter><a href="window.html">2. Window Layout</a></p>
 
    <ul>
-     <li>A tour of the Disobedience window.</li>
+     <li>A tour of the Disobedience window</li>
    </ul>
 
    <p class=chapter><a href="tabs.html">3. Tabs</a></p>
@@ -47,28 +47,28 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    <ul>
      <li>Detailed descriptions of
        the <b>Queue</b>, <b>Recent</b>, <b>Choose</b> and <b>Added</b>
-       tabs.</li>
+       tabs</li>
    </ul>
 
    <p class=chapter><a href="properties.html">4. Track Properties</a></p>
 
    <ul>
-     <li>How to edit track properties.</li>
+     <li>How to edit track properties</li>
    </ul>
 
    <p class=chapter><a href="playlists.html">5. Playlists</a></p>
 
    <ul>
-     <li>What playlists are.</li>
-     <li>Editing playlists.</li>
+     <li>What playlists are</li>
+     <li>Editing playlists</li>
    </ul>
 
    <p class=chapter><a href="misc.html">Appendix</a></p>
 
    <ul>
-     <li>Network play.</li>
-     <li>Reporting bugs.</li>
-     <li>Copyright notice.</li>
+     <li>Network play</li>
+     <li>Reporting bugs</li>
+     <li>Copyright notice</li>
    </ul>
 
  </body>
index 829ae2f..52d0915 100644 (file)
@@ -59,6 +59,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    cover a few such topics as they are necessary to getting up and
    running with Disobedience.</p>
 
+   <!--
+
    <p>This diagram shows an overview of one possible setup.</p>
 
    <p class=image><img src="arch-simple.png"></p>
@@ -75,6 +77,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    on the same computer as the server provided it can run X11
    applications.</p>
 
+   -->
+
    <h2><a name=getting>1.2 Getting DisOrder</a></h2>
 
    <p>There are two ways to get DisOrder.</p>
diff --git a/disobedience/manual/playlist-create.png b/disobedience/manual/playlist-create.png
new file mode 100644 (file)
index 0000000..f48997d
Binary files /dev/null and b/disobedience/manual/playlist-create.png differ
diff --git a/disobedience/manual/playlist-picker-menu.png b/disobedience/manual/playlist-picker-menu.png
new file mode 100644 (file)
index 0000000..be5a65b
Binary files /dev/null and b/disobedience/manual/playlist-picker-menu.png differ
diff --git a/disobedience/manual/playlist-popup-menu.png b/disobedience/manual/playlist-popup-menu.png
new file mode 100644 (file)
index 0000000..0bb673d
Binary files /dev/null and b/disobedience/manual/playlist-popup-menu.png differ
diff --git a/disobedience/manual/playlist-window.png b/disobedience/manual/playlist-window.png
new file mode 100644 (file)
index 0000000..9ffd991
Binary files /dev/null and b/disobedience/manual/playlist-window.png differ
index d83ad6c..bef0c18 100644 (file)
@@ -62,8 +62,6 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
    <h2><a name=creating>5.2 Creating Playlists</a></h2>
 
-   <!-- TODO rewrite with screenshots -->
-
    <p>To create a playlist, click the <b>Add</b> button in the
    playlist editor.  This will create a pop-up window where you can
    enter the name of the new playlist and decide whether it is
@@ -72,10 +70,15 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    <p>Only Roman letters (without any accents) and digits are allowed
    in playlist names.</p>
 
+   <p class=image><img src="playlist-create.png"></p>
+
    <h2><a name=editing>5.3 Editing Playlists</a></h2>
 
-   <!-- TODO rewrite with screenshots - might be worth waiting until
-   picker is a tree -->
+   <p>You can select the playlist to edit from the left side of the
+   window.  Shared playlists are listed first, then the public
+   playlists of each user (plus private playlists that you own).</p>
+
+   <p class=image><img src="playlist-window.png"></p>
 
    <p>When a playlist is selected, you can edit in the right hand half
    of the playlist window.  The editor is very similar in structure
@@ -83,22 +86,28 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
    rearrange tracks within it by drag and drop and you can drag tracks
    from the <b>Choose</b> tab into it.</p>
 
+   <p>Right clicking will create a pop-up menu which you can use to
+   play indivudual tracks or the whole playlist, as well as the
+   usual options as found in the <b>Queue</b> tab.</p>
+
+   <p class=image><img src="playlist-popup-menu.png"></p>
+
    <h2><a name=playing>5.3 Playing Playlists</a></h2>
 
    <p>There are three ways to play a playlist:</p>
 
    <ol>
 
-     <li>Right clicking in the playlist editor will create a pop-up
-     menu.  In addition to the familiar options there is an option to
-     play this playlist.</li>
+     <li>You can use <b>Control > Activate Playlist</b> from the main
+     menu.</li>
+
+     <li>Right clicking in either half of the playlist editor will
+     create a pop-up menu.  There is an option to play this
+     playlist.</li>
 
      <li>You can select all the tracks and drag them to the desired
      point in the <b>Queue</b> tab.</li>
 
-     <li>You can use <b>Control > Activate Playlist</b> from the main
-     menu.</li>
-
    </ol>
 
    <hr>
index 54c24f9..b5520b9 100644 (file)
@@ -149,7 +149,7 @@ static struct menuitem playlist_menuitems[] = {
   { "Track properties", ql_properties_activate, ql_properties_sensitive, 0, 0 },
   { "Play track", ql_play_activate, ql_play_sensitive, 0, 0 },
   { "Play playlist", playlist_playall_activate, playlist_playall_sensitive, 0, 0 },
-  { "Remove track from queue", playlist_remove_activate, playlist_remove_sensitive, 0, 0 },
+  { "Remove track from playlist", playlist_remove_activate, playlist_remove_sensitive, 0, 0 },
   { "Select all tracks", ql_selectall_activate, ql_selectall_sensitive, 0, 0 },
   { "Deselect all tracks", ql_selectnone_activate, ql_selectnone_sensitive, 0, 0 },
 };
index c4c814e..39514ed 100644 (file)
@@ -264,6 +264,7 @@ size_t resample_convert(const struct resampler *rs,
   if(rs->state) {
     /* A sample-rate conversion must be performed */
     SRC_DATA data;
+    memset(&data, 0, sizeof data);
     /* Compute how many frames are expected to come out. */
     size_t maxframesout = nframesin * rs->output_rate / rs->input_rate + 1;
     output = xcalloc(maxframesout * rs->output_channels, sizeof(float));
@@ -273,11 +274,16 @@ size_t resample_convert(const struct resampler *rs,
     data.output_frames = maxframesout;
     data.end_of_input = eof;
     data.src_ratio = (double)rs->output_rate / rs->input_rate;
+    D(("nframesin=%zu maxframesout=%zu eof=%d ratio=%d.%06d",
+       nframesin, maxframesout, eof,
+       (int)data.src_ratio,
+       ((int)(data.src_ratio * 1000000) % 1000000)));
     int error_ = src_process(rs->state, &data);
     if(error_)
       disorder_fatal(0, "calling src_process: %s", src_strerror(error_));
     nframesin = data.input_frames_used;
     nsamplesout = data.output_frames_gen * rs->output_channels;
+    D(("new nframesin=%zu nsamplesout=%zu", nframesin, nsamplesout));
   }
 #endif
   if(!output) {
index bcfc3a8..8935927 100644 (file)
@@ -188,6 +188,8 @@ int main(int argc, char attribute((unused)) **argv) {
     }
     if(!n)
       break;
+    D(("NEW HEADER: %"PRIu32" bytes %"PRIu32"Hz %"PRIu8" channels %"PRIu8" bits %"PRIu8" endian",
+       header.nbytes, header.rate, header.channels, header.bits, header.endian));
     /* Sanity check the header */
     if(header.rate < 100 || header.rate > 1000000)
       disorder_fatal(0, "implausible rate %"PRId32"Hz (%#"PRIx32")",
@@ -210,7 +212,8 @@ int main(int argc, char attribute((unused)) **argv) {
     else {
       /* If we have a resampler active already check it is suitable and destroy
        * it if not */
-      if(!formats_equal(&header, &latest_format) && rs_in_use) {
+      if(rs_in_use) {
+        D(("call resample_close"));
         resample_close(rs);
         rs_in_use = 0;
       }
@@ -227,6 +230,7 @@ int main(int argc, char attribute((unused)) **argv) {
              config->sample_format.endian);*/
       if(!rs_in_use) {
         /* Create a suitable resampler. */
+        D(("call resample_init"));
         resample_init(rs,
                       header.bits,
                       header.channels, 
@@ -260,17 +264,21 @@ int main(int argc, char attribute((unused)) **argv) {
           left -= r;
           used += r;
           //syslog(LOG_INFO, "read %zd bytes", r);
+          D(("read %zd bytes", r));
         }
         /*syslog(LOG_INFO, " in: %02x %02x %02x %02x",
                (uint8_t)buffer[0],
                (uint8_t)buffer[1], 
                (uint8_t)buffer[2],
                (uint8_t)buffer[3]);*/
+        D(("calling resample_convert used=%zu !left=%d", used, !left));
         const size_t consumed = resample_convert(rs,
                                                  (uint8_t *)buffer, used,
                                                  !left,
                                                  converted, 0);
         //syslog(LOG_INFO, "used=%zu consumed=%zu", used, consumed);
+        D(("consumed=%zu", consumed));
+        assert(consumed != 0);
         memmove(buffer, buffer + consumed, used - consumed);
         used -= consumed;
       }