Changeset 44
- Timestamp:
- 08/15/10 16:10:41 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 modified
-
INSTALL (modified) (1 diff)
-
README (modified) (1 diff)
-
TODO (modified) (1 diff)
-
radiomate/config.py (modified) (1 diff)
-
radiomate/jukeslots/base.py (modified) (1 diff)
-
radiomate/jukeslots/main.py (modified) (1 diff)
-
radiomate/jukeslots/simplelive.py (modified) (1 diff)
-
radiomate/jukeslots/simpleplaylist.py (modified) (1 diff)
-
radiomate0.sql (modified) (9 diffs)
-
radiomateconfig.sample.py (modified) (1 diff)
-
tests/slottest.py (added)
-
tests/testclear.sql (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/INSTALL
r35 r44 32 32 python setup.py install 33 33 34 - To initalize the MySQL database, the radiomate0.sql script is provided. 34 - To initalize the MySQL database, the radiomate0.sql script is provided. It 35 assumes that a database (for example called radiomate, has been created). 36 Then, from the command line, it can be ran with: 37 38 mysql -u root -p radiomate < radiomate0.sql 39 40 - an user foobar with password secret and with admin (i.e. all) privileges will 41 be created. 35 42 36 43 - Copy the radiomateconfig.cgi file to your Web server's CGI directory. -
trunk/README
r35 r44 78 78 directory and use them as template for the new JukeSlot classes. 79 79 80 Write your own liquidsoap code inside the liquidsoapcode() method. The code 81 must contain a variable named "radio". The stream correspondig to this 82 variable will be forwarded (at runtime) to the main jukeslot istance. 83 80 84 - be sure to add a JUKESLOTTYPEDICT entry at the end of the file. For example, 81 85 at the end of simplelive.py we have the line: -
trunk/TODO
r35 r44 1 1 $Id$ 2 2 3 - when adding audio file take info from ID3 tags 3 - web interface. Wordpress plug-in? 4 - CGI upload, return response w/ new inserted mediafile with id and author, title taken from id3 tags 5 - add mediafile.length 4 6 - test searching by tag 5 7 - add "limit" attributes to JSON requests 8 - jingles between two transmissions 9 - jingleplaylist (config.) 10 - 1) change transfunction chosing random jingle from playlist 11 - j = fallback(track_sensitive=false, [random([jingle1, jingle2]), blank(duration=2.)]) 12 transjingle = fun(a,b) -> sequence([fade.final(a, type="sin"), fade.in(fade.out(j)), fade.initial(b, type="sin")]) 13 - or 2) use the rotate() function 14 - make an archive copy of transmission 15 - during the transmission save with output.file the same stream. 16 - jukeslot plugins: no more output.icecast blabla but finish with radio=... 17 - then append to the liq code output.icecast(radio) output.file(radio) 18 - take the new file, put it in the uploads dir and register it 19 - new mediafile bit: netcast 20 - change db change mate change dao 21 - update timeslot w/ id mediafile -> archived 22 - change db change mate change dao for archived property 23 - make a commonif used by jsonif, to make radiomate extendable also to non-json interfaces 6 24 25 - make a WSGI script instead of the CGI 7 26 - port to couchdb 8 - make a WSGI script instead of the CGI9 27 10 28 - grep -r TODO * -
trunk/radiomate/config.py
r34 r44 16 16 # Logging 17 17 LOGFILENAME = "/tmp/radiomate.log" 18 LOGGINGLEVEL = logging. DEBUG18 LOGGINGLEVEL = logging.INFO 19 19 20 20 # Database parameters -
trunk/radiomate/jukeslots/base.py
r42 r44 86 86 if r: 87 87 raise JukeSlotException("liquidsoap instance not running (exitcode %d)" % r) 88 89 if main: 90 # the main jukeslot forwards to the icecast server 91 liq += """ 92 output.icecast.mp3( 93 host='%s', 94 port = %d, 95 password = "%s", 96 mount = "%s", 97 restart=true, 98 description="%s", 99 url="%s", 100 radio) 101 """ % (config.ICECASTSERVER, config.ICECASTPORT, config.ICECASTPASSWORD, 102 config.ICECASTMAINMOUNT, config.RADIONAME, config.RADIOURL) 103 self.logger.info("Starting main liquidsoap istance") 104 else: 105 # the secondary jukeslots forward to the main jukeslot 106 liq += """ 107 def rewritemeta(m) = 108 [("song", "%s - %s")] 109 end 110 radio = map_metadata(rewritemeta, radio) 111 112 output.icecast.mp3( 113 host='127.0.0.1', 114 port = %d, 115 password = "%s", 116 mount = "radiomate.mp3", 117 restart=true, 118 description="%s", 119 radio) 120 """ % (self.title, self.description, config.INTERNALJUKEPORT, self.mainpassword, self.title) 121 self.logger.info("Starting secondary liquidsoap istance") 88 122 89 123 time.sleep(1) -
trunk/radiomate/jukeslots/main.py
r42 r44 78 78 ) 79 79 80 output.icecast.mp3(81 host='%s',82 port = %d,83 password = "%s",84 mount = "%s",85 restart=true,86 description="%s",87 url="%s",88 radio)89 80 90 """ % (config.INTERNALJUKEPORT, self.getFallBackPlayListLiquidCode(), self.getPassword(), 91 config.TAKEOVERMOUNTURL, config.ICECASTSERVER, config.ICECASTPORT, 92 config.ICECASTPASSWORD, config.ICECASTMAINMOUNT, config.RADIONAME, 93 config.RADIOURL) 94 self.logger.info("Starting main liquidsoap istance") 81 """ % (config.INTERNALJUKEPORT, self.getFallBackPlayListLiquidCode(), 82 self.getPassword(), config.TAKEOVERMOUNTURL) 95 83 return liq 96 84 -
trunk/radiomate/jukeslots/simplelive.py
r42 r44 49 49 transitions=[transfunction, transfunction, transfunction]) 50 50 51 def rewritemeta(m) =52 [("song", "%s")]53 end54 radio = map_metadata(rewritemeta, radio)55 56 output.icecast.mp3(57 host='127.0.0.1',58 port = %d,59 password = "%s",60 mount = "radiomate.mp3",61 restart=true,62 description="%s",63 radio)64 51 """ % (config.LIVESTREAMPORT, self.slotparams['livepassword'], config.LIVESTREAMMOUNT, 65 self.getFallBackPlayListLiquidCode(), self.title, config.INTERNALJUKEPORT, 66 self.mainpassword, self.title) 52 self.getFallBackPlayListLiquidCode()) 67 53 return liq 68 54 -
trunk/radiomate/jukeslots/simpleplaylist.py
r42 r44 50 50 ) 51 51 52 output.icecast.mp3(53 host='127.0.0.1',54 port = %d,55 password = "%s",56 mount = "radiomate.mp3",57 radio)58 52 59 """ % (self.getPlayListLiquidCode(self.playlist.id), self.getFallBackPlayListLiquidCode(), 60 config.INTERNALJUKEPORT, self.mainpassword) 53 """ % (self.getPlayListLiquidCode(self.playlist.id), self.getFallBackPlayListLiquidCode()) 61 54 self.logger.info("Starting playlist jukeslot") 62 55 return liq -
trunk/radiomate0.sql
r37 r44 4 4 -- 5 5 -- Host: localhost 6 -- Generation Time: Aug 1 3, 2010 at 06:46PM6 -- Generation Time: Aug 15, 2010 at 04:47 PM 7 7 -- Server version: 5.1.47 8 8 -- PHP Version: 5.3.2 … … 33 33 KEY `mediafile` (`mediafile`) 34 34 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 35 36 -- 37 -- Dumping data for table `compilation` 38 -- 35 39 36 40 -- -------------------------------------------------------- … … 59 63 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 60 64 65 -- 66 -- Dumping data for table `mediafiles` 67 -- 68 69 61 70 -- -------------------------------------------------------- 62 71 … … 71 80 KEY `user` (`user`) 72 81 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 82 83 -- 84 -- Dumping data for table `playlistowners` 85 -- 86 73 87 74 88 -- -------------------------------------------------------- … … 92 106 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 93 107 108 -- 109 -- Dumping data for table `playlists` 110 -- 111 112 94 113 -- -------------------------------------------------------- 95 114 … … 104 123 KEY `user` (`user`) 105 124 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 125 126 -- 127 -- Dumping data for table `playlistviewers` 128 -- 129 106 130 107 131 -- -------------------------------------------------------- … … 125 149 PRIMARY KEY (`rolename`) 126 150 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 151 152 -- 153 -- Dumping data for table `roles` 154 -- 155 156 INSERT INTO `roles` (`rolename`, `canManageRoles`, `canManageUsers`, `canManageAllPlaylists`, `canRegisterFiles`, `canManageRegisteredFiles`, `canManageTimetable`, `fixedSlotTimes`, `changeTimeBeforeTransmission`, `canCreateTestSlot`, `fixedSlotTimesList`) VALUES 157 ('admin', 1, 1, 1, 1, 1, 1, 1, -1, 1, '60,120'); 127 158 128 159 -- -------------------------------------------------------- … … 151 182 ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 152 183 184 -- 185 -- Dumping data for table `timeslots` 186 -- 187 188 153 189 -- -------------------------------------------------------- 154 190 … … 167 203 168 204 -- 205 -- Dumping data for table `users` 206 -- 207 208 INSERT INTO `users` (`name`, `password`, `role`, `displayname`) VALUES 209 ('foobar', 'e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4', 'admin', 'Foo Bar'); 210 211 -- 169 212 -- Constraints for dumped tables 170 213 -- -
trunk/radiomateconfig.sample.py
r35 r44 12 12 # Logging 13 13 LOGFILENAME = "/tmp/radiomate.log" 14 LOGGINGLEVEL = logging. DEBUG14 LOGGINGLEVEL = logging.INFO 15 15 16 16 # MySQL database parameters