More changes to standardize Songbook
authorAndrew DeFaria <Andrew@DeFaria.com>
Tue, 21 Jun 2016 01:43:44 +0000 (18:43 -0700)
committerAndrew DeFaria <Andrew@DeFaria.com>
Tue, 21 Jun 2016 01:43:44 +0000 (18:43 -0700)
songbook/Media/Across the Universe.mp3 [new file with mode: 0644]
songbook/Media/Strong Enough to Win.mp3 [new file with mode: 0644]
songbook/Songs/Across the Universe.pro
songbook/Songs/All You Need Is Love.pro
songbook/web/displayartist.php
songbook/web/songbook.php
songbook/web/webchord.cgi

diff --git a/songbook/Media/Across the Universe.mp3 b/songbook/Media/Across the Universe.mp3
new file mode 100644 (file)
index 0000000..ebf9365
Binary files /dev/null and b/songbook/Media/Across the Universe.mp3 differ
diff --git a/songbook/Media/Strong Enough to Win.mp3 b/songbook/Media/Strong Enough to Win.mp3
new file mode 100644 (file)
index 0000000..3e0c860
Binary files /dev/null and b/songbook/Media/Strong Enough to Win.mp3 differ
index 3bf5ae2..e62c99c 100644 (file)
@@ -39,4 +39,4 @@ It c[Em]alls me on and on [A]across the universe
 
 {c:Chorus}
 {tempo-android:60}
-{zoom-android:1.3710576}
\ No newline at end of file
+{zoom-android:1.3710576}{musicpath:/storage/emulated/0/SongBook/Media/Across the Universe.mp3}
index ade4736..2dcf2aa 100644 (file)
@@ -1,5 +1,5 @@
 {title:All You Need Is Love}
-{subtitle:ohn Lennon/Paul McCartney}
+{subtitle:John Lennon/Paul McCartney}
 
 {c:Intro}
 
index 313908f..a99fb5e 100644 (file)
@@ -4,7 +4,7 @@
 <head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Mozilla/4.61 [en] (Win98; U) [Netscape]">
-  <title>Songbook" Artist</title>
+  <title>Songbook Artist</title>
   <link rel="stylesheet" type="text/css" media="screen" href="/css/Music.css">
   <link rel="stylesheet" type="text/css" media="print" href="/css/Print.css">
   <link rel="SHORTCUT ICON" href="http://defaria.com/favicon.ico" type="image/png">
index f66bcdb..54d5fea 100644 (file)
@@ -5,16 +5,16 @@ $songs   = glob (dirname($baseDir) . "/Songs/*.pro");
 function getSongs () {
   global $songs;
 
-  $path = $baseDir . "../Songs/*.pro";
+  $path = "/opt/clearscm/songbook/Songs";
 
   // Why didn't the previous one execute correctly?
-  $songs = glob($baseDir . '../Songs/*.pro');
+  $songs = glob("$path/*.pro");
 } // getSongs
 
 function songsDropdown () {
   global $songs;
 
-  print "<form method=\"post\" action=\"webchord.cgi\" name=\"song\">";
+  print "<form method=\"get\" action=\"webchord.cgi\" name=\"song\">";
   print "Songs:&nbsp;&nbsp;";
   print "<select name=\"chordpro\">";
 
@@ -23,11 +23,11 @@ function songsDropdown () {
     $title = basename ($song, ".pro");
     $artist = getArtist ($song);
 
+    print "<option value=\"$title.pro\">$title</option>";
+
     if ($artist != "") {
       $title .= "&nbsp;($artist)";
     } // if
-
-    print "<option value=\"$song\">$title</option>";
   } // foreach
 
   print "<input type=\"submit\" value=\"Go\">";
@@ -40,7 +40,7 @@ function artistsDropdown () {
 
   $artists = getArtists ($songs);
 
-  print "<form method=\"post\" action=\"displayartist.php\" name=\"artist\">";
+  print "<form method=\"get\" action=\"displayartist.php\" name=\"artist\">";
   print "Artists:&nbsp;&nbsp;";
   print "<select name=\"artist\">";
 
index ef2da05..48add33 100755 (executable)
@@ -26,6 +26,14 @@ my $documentRoot = "/web";
 my $debug        = param ('debug');
 my $infile       = param ('chordpro');
 
+unless (-f $infile) {
+  $infile = '/opt/clearscm/songbook/Songs/' . $infile;
+
+  unless (-f $infile) {
+    print "Unable to $infile";
+    exit 1;
+  } # unless
+} # unless
 
 sub debug ($) {
   my ($msg) = @_;
@@ -63,14 +71,14 @@ sub musicFileExists ($) {
   debug "ENTER musicFileExists ($song)";
   
   my $title     = fileparse ($song, qr/\.pro/);
-  my $musicfile = "/songbook/Media/$title.mp3";
+  my $musicfile = "/opt/clearscm/songbook/Media/$title.mp3";
 
-  if (-r "$documentRoot$musicfile") {
+  if (-r $musicfile) {
     debug "Exists!";
     
     return $title;
   } else {
-    debug "Could not find $documentRoot$musicfile";
+    debug "Could not find $musicfile";
     
     return undef;
   } # if
@@ -203,7 +211,7 @@ END
         print <<"END";
 <td align="right">
 <audio controls autoplay>
- <source src="http://defaria.com/songbook/Media/$title.mp3" type='audio/mp3'>
+ <source src="http://defaria.com/Media/$title.mp3" type='audio/mp3'>
  <p>Your user agent does not support the HTML5 Audio element.</p>
 </audio>
 </td>