diff options
author | LarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-03-06 15:12:54 +0000 |
---|---|---|
committer | LarsAC <LarsAC@e10066b5-e1e2-0310-b819-94efdf66514b> | 2005-03-06 15:12:54 +0000 |
commit | 1b904acf111207063f9eec70fbe7f6acfd426af3 (patch) | |
tree | 2595d69903d0b3e4b4813a875ad2960afd468908 | |
parent | c9328c668203dbcd43a9362de9a22c5d214086c4 (diff) | |
download | vdr-plugin-muggle-1b904acf111207063f9eec70fbe7f6acfd426af3.tar.gz vdr-plugin-muggle-1b904acf111207063f9eec70fbe7f6acfd426af3.tar.bz2 |
Corrected minor issues for next release
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/tags/0.1.4-BETA@547 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README | 152 | ||||
-rw-r--r-- | mg_mysql.c | 2 | ||||
-rwxr-xr-x | scripts/createdb.mysql | 16 | ||||
-rwxr-xr-x | scripts/createtables.mysql | 246 | ||||
-rwxr-xr-x | scripts/make-empty-db | 19 | ||||
-rw-r--r-- | vdr_setup.h | 2 |
8 files changed, 80 insertions, 363 deletions
@@ -135,7 +135,7 @@ XXXXXXXXXX: Version 0.0.8-ALPHA die Aufrufe mysql_server_init/end zu entfernen. Das README hat schon immer mindestens 4.0.18 empfohlen. -2005-03-XX: Version 0.1.4-BETA +2005-03-06: Version 0.1.4-BETA - embedded mysql server as default. If you want to use an external server as before, read the README file - If the embedded version find the database missing, it offers to create @@ -16,7 +16,7 @@ PLUGIN = muggle #if you want to use a dedicated Mysql server instead of the embedded code, #define this in $VDRDIR/Make.config: -# HAVE_SERVER +# HAVE_SERVER=1 # ### The version number of this plugin (taken from the main source file): @@ -58,7 +58,7 @@ DEFINES += -D_GNU_SOURCE -DPLUGIN_NAME_I18N='"$(PLUGIN)"' ### The object files (add further files here): OBJS = $(PLUGIN).o i18n.o mg_valmap.o mg_mysql.o mg_sync.o mg_order.o mg_content.o mg_selection.o vdr_actions.o vdr_menu.o mg_tools.o \ - vdr_decoder_mp3.o vdr_stream.o vdr_decoder.o vdr_player.o \ + vdr_decoder_mp3.o vdr_decoder_ogg.o vdr_decoder_flac.o vdr_stream.o vdr_decoder.o vdr_player.o \ vdr_setup.o mg_setup.o LIBS = -lmad -ltag @@ -37,9 +37,11 @@ parameters are descibed in Section 5. The plugin currently runs on versions 1.3.17- of VDR (including 1.2.6). It also compiles on 1.3.18 but your mileage may vary. In addition, the following pieces of software are required: - - mySQL server (tested with 4.0.18) (Debian packages mysql-server, mysql-client) - mySQL client libraries + - mySQL client libraries (Debian package libmysqlclient-dev or http://www.mysql.org) + - mySQL server (tested with 4.0.18) (Debian packages mysql-server, mysql-client) + only needed, if you want to run the database server on a remote machine - libmad (for mp3 decoding) (Debian package libmad0-dev or http://www.underbit.com/products/mad/) @@ -72,9 +74,23 @@ Establish a symlink as you would for other plugins: ln -s muggle-0.1.1 muggle \endverbatim -Adapt the Makefile to your system. Define HAVE_VORBIS and/or HAVE_FLAC and adapt the LIBS variable accordingly. +Adapt the Makefile to your system. Define HAVE_VORBIS and/or HAVE_FLAC and adapt +the LIBS variable accordingly. -Within the VDR main directory (e.g. /usr/local/src/VDR) issue +NOTE: By default, muggle will be built using the embedded mysql library so that it is +not required to install further packages or run additional services. If you want to use +the remote server as in previous versions, you have to define the variable HAVE_SERVER +in the Makefile by uncommenting the corresponding line. + +NOTE: If you have not installed the mysql server package on your machine the files +containing error messages for MySQL you will see an error message like this: + +050306 9:29:14 Can't find messagefile '/usr/share/mysql/english/errmsg.sys' +050306 9:29:14 Aborting + +In this case you need to obtain these files and put them there. + +Then, within the VDR main directory (e.g. /usr/local/src/VDR) issue \verbatim make plugins @@ -83,106 +99,68 @@ Within the VDR main directory (e.g. /usr/local/src/VDR) issue This should build all relevant stuff. If you have difficulties, check that required libraries are in the library directories stated in the muggle Makefile. -\section import IMPORT +Note: On my Debian sarge system, I had difficulties because a proper symlink for libwrap.so was +missing. Check this in case the compiler complains about a missing -lwrap. -The import is done in two steps: First, a database is created and initialized with proper data structures (so-called schema). -Then, these data structures are filled from the ID3 tags of your music tracks. +\section SET UP MUGGLE WITH EMBEDDED MYSQL -\subsection dbsetup Setup Database +The step of setting up the database and importing music has been simplified a lot +for Muggle using the embedded MySQL server. When starting up muggle the first time +it will determine that the database does not exist and will ask, whether to +create the database. Confirm this with Ok. -This step can be done on the database server or on some other client machine. -Within the directory scripts there are a few helpful files to support setting -up the database. Change into that directory:# +After successfully creating the database, muggle will query whether to import music. +Confirm this question with Ok, too. Muggle will now recursively descend into the +directories below the music directory specified with the -t option on the command line. +Once muggle is running, you can import new tracks and read updated tags by a command +in the setup menu. The use of mugglei is still possible, but only while VDR is not +running (because muggle will then block the use of the database). -\verbatim - cd scripts -\endverbatim +NOTE: The embedded MySQL server cannot be used by other programs. The use of the +GiantDisc web interface for example is not possible. -The first step is to essentially create the database: +\section SET UP MUGGLE WITH REMOTE MYSQL -\verbatim - mysql -u root -p < createdb.mysql -\endverbatim +If you already have a MySQL server running in your network (e.g. as a basis +for a webserver) or want to access the music database with other programs +(e.g. the GiantDisc web interface) you may be interested in using -You will need to enter your root password that you choose during mySQL installation. -Next, we generate the database tables (schema): +This step can be done on the database server or on some other client machine. +The scripts in the directory scripts is no longer needed. Instead, mugglei can +now also create new databases and provide basic information about existing languages, +genres etc. A small utility called 'mugglei' to administer the database has been +created along with the plugin. Run \verbatim - mysql -u root -p < createtables.mysql + mugglei -c \endverbatim -Further, initial data about known languages, genres, sources and musictypes is fed into the database: -Execute these commands on a single line, the \ for the linebreak ist just for presentation purposes here. - -\verbatim - echo " use GiantDisc; load data local infile 'genres.txt' into table genre;" | \ - mysql -u root -p --local-infile=1 +to create a database and initialize the tables. This replaces the series of commands +needed in former commands. If you want to change the server or database name look at +the command line arguments (execute mugglei without arguments to see a list). - echo "use GiantDisc; load data local infile 'languages.txt' into table language;" | \ - mysql -u root --local-infile=1 - - echo "use GiantDisc; load data local infile 'musictypes.txt' into table musictype;" | \ - mysql -u root --local-infile=1 - - echo "use GiantDisc; load data local infile 'sources.txt' into table source;" | \ - mysql -u root --local-infile=1 -\endverbatim +\subsection importremote Import for Muggle with remote MySQL -You can find the sequence of commands in the file scripts/make-empty-db. Use it at your own luck after making necessary modification (program paths, database names, servers, users, etc.). - -Please note, that the scripts and commands above are quite basic in terms of security (e.g. no -password set for the vdr user, no proper selection of privileges). You may want to spend some -time reading the mySQL documentation in order to set up a proper configuration. Especially when -VDR and mySQL will run on different machines you'll have to invest some time into mySQL -networking and access rights. - -If you want your database name to be different than 'GiantDisc' you will need to adapt the name -in the files createdb.mysql and createtables.mysql and in the commands above. Now your database -is ready for import. - -\subsection importfile Import Music - -The next step is to feed all music information into the database. There is a small tool called 'mugglei' -in the muggle main directory. It connects to the database, evaluates ID3 tags from a file, and writes -the tags into the database. It runs on just one file, so you need some more effort using the Unix command -'find' to take all files into consideration. +The next step is to feed all music information into the database. To accomplish this, mugglei +connects to the database, evaluates ID3 tags from a file, and writes the tags into the +database. Since release 0.1.4 mugglei recursively descends a file system hierarchy so that +the use of find is no longer needed. For this step, it is helpful, that all music files are somehow gathered under a toplevel directory. It does not matter whether there are further subdirectories which organize files into genres, artists, album or whatever. If this is not the case, you may want to take some time to do this. Read on before -you start - -You probably do not want to import all files in one go: albums on which tracks of various artists are found -(samplers) require different treatment than files of just one artist. What I did: all samplers are collected -below a special subdirectory "Assorted". Import is then run separately for those tracks. There has been discussion -about this and ideas for better solutions are welcome. - -For now, let's assume your music tracks are located in /home/music and samplers are in /home/music/Assorted. - -First, import the files in Assorted. This requires the flag -a to mugglei. Further flags -h, -n, -u, and -p -specify database host, name, user and password, respectively. The filename to import is given using the -f -directive. Using 'find' you can import all files for assorted albums with a command like: +you start. Executing \verbatim - find Assorted -name '*' -type f -exec mugglei -a -f {} \; + mugglei * \endverbatim -For reasons of simplicity, the arguments -h, -n, -u and -p are not shown. You will need them if the default -values do not apply or modify the source code accordingly (beginning of function main). Also, make sure -that either mugglei is on your path or specify an absolute or relative path in the above command line. +will import all music files (*.mp3., *.ogg, *.flac) below the current directory. Obviously, +you may need additional options for the database host, user, etc. +It is important that you perform various import steps from the same location so the +filenames are relative to exactly the same directory (e.g. /home/music in the example case). -For "regular" albums, the following command may be helpful: - -\verbatim - find * -path 'Assorted' -prune -o -type f -exec mugglei -f {} \; -\endverbatim - -It is important that you perform all these steps from the same location so the filenames are relative to -exactly the same directory (e.g. /home/music in the example case). - -Speed should not be an issue: on my machine, it takes about 10 secs to run the import of 60 assorted -albums with more than 600 tracks. Further 1200 tracks or so require 20 more secs. This depends on machine -configuration, of course. +NOTE: The options -f and -a are no longer needed. mugglei should now automatically do the right thing. If a track has no ID3 tags, the following defaults will be applied: @@ -194,8 +172,13 @@ If a track has no ID3 tags, the following defaults will be applied: \section config MUGGLE CONFIGURATION -Muggle uses a small set of command line parameters in order to control -the interaction with the mySQL server. Let's look at an example: +In case you use mugglei with the embedded MySQL server the most important +options are -d DIR (controls where the database file is created) and +-t DIR (controls where the music resides). + +When using the remote MySQL server, muggle uses a small set of command line +parameters in order to control the interaction with the mySQL server. Let's +look at an example: \verbatim -P'muggle -h localhost -u vdr -n GiantDisc -t/home/music' @@ -209,6 +192,9 @@ The -t argument specifies the top level directory of the music files. On a local installation, this is the directory in which you executed the import steps (Chapter 4.2). +In case you want to use Muggle with the embedded MySQL server, specify the +directory to place the database into with the option -d DIR. + \section quickuse QUICK INTRO Quick version: select Muggle on the OSD, browse titles (using up/down and Ok), @@ -16,7 +16,7 @@ #include <sys/types.h> #include <time.h> -#include "vdr_setup.h" +#include "mg_setup.h" bool needGenre2; static bool needGenre2_set; diff --git a/scripts/createdb.mysql b/scripts/createdb.mysql index 7ccdc89..da1234a 100755 --- a/scripts/createdb.mysql +++ b/scripts/createdb.mysql @@ -1,14 +1,2 @@ -/* Creates DB and opens it to any user */ -/* Run this mysql macro as root! */ - -DROP DATABASE IF EXISTS GiantDisc; -CREATE DATABASE GiantDisc; - -use GiantDisc; - -/* The first line is useful for granting access to user vdr on all computers in a network. */ -/* grant all privileges on GiantDisc.* to vdr@'%'; */ - -/* Grant access to user vdr on the local machine */ -grant all privileges on GiantDisc.* to vdr@localhost; - +-- NO LONGER NEEDED. +-- SEE README
\ No newline at end of file diff --git a/scripts/createtables.mysql b/scripts/createtables.mysql index 708bdd2..da1234a 100755 --- a/scripts/createtables.mysql +++ b/scripts/createtables.mysql @@ -1,244 +1,2 @@ --- MySQL dump 8.21 --- --- Host: localhost Database: GiantDisc ---------------------------------------------------------- --- Server version 3.23.49 - --- --- Current Database: GiantDisc --- - ---CREATE DATABASE /*!32312 IF NOT EXISTS*/ GiantDisc; - -USE GiantDisc; - --- --- Table structure for table 'album' --- - -drop table if exists album; -CREATE TABLE album ( - artist varchar(255) default NULL, - title varchar(255) default NULL, - cddbid varchar(20) NOT NULL default '', - coverimg varchar(255) default NULL, - covertxt mediumtext, - modified date default NULL, - genre varchar(10) default NULL, - PRIMARY KEY (cddbid), - KEY artist (artist(10)), - KEY title (title(10)), - KEY genre (genre), - KEY modified (modified) -) TYPE=MyISAM; - --- --- Table structure for table 'genre' --- - -drop table if exists genre; -CREATE TABLE genre ( - id varchar(10) NOT NULL default '', - id3genre smallint(6) default NULL, - genre varchar(255) default NULL, - freq int(11) default NULL, - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'language' --- - -drop table if exists language; -CREATE TABLE language ( - id varchar(4) NOT NULL default '', - language varchar(40) default NULL, - freq int(11) default NULL, - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'musictype' --- - -drop table if exists musictype; -CREATE TABLE musictype ( - musictype varchar(40) default NULL, - id tinyint(3) unsigned NOT NULL auto_increment, - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'player' --- - -drop table if exists player; -CREATE TABLE player ( - ipaddr varchar(255) NOT NULL default '', - uichannel varchar(255) NOT NULL default '', - logtarget int(11) default NULL, - cdripper varchar(255) default NULL, - mp3encoder varchar(255) default NULL, - cdromdev varchar(255) default NULL, - cdrwdev varchar(255) default NULL, - id int(11) NOT NULL default '0', - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'playerstate' --- - -drop table if exists playerstate; -CREATE TABLE playerstate ( - playerid int(11) NOT NULL default '0', - playertype int(11) NOT NULL default '0', - snddevice varchar(255) default NULL, - playerapp varchar(255) default NULL, - playerparams varchar(255) default NULL, - ptlogger varchar(255) default NULL, - currtracknb int(11) default NULL, - state varchar(4) default NULL, - shufflepar varchar(255) default NULL, - shufflestat varchar(255) default NULL, - pauseframe int(11) default NULL, - framesplayed int(11) default NULL, - framestotal int(11) default NULL, - anchortime bigint(20) default NULL, - PRIMARY KEY (playerid,playertype) -) TYPE=HEAP; - --- --- Table structure for table 'playlist' --- - -drop table if exists playlist; -CREATE TABLE playlist ( - title varchar(255) default NULL, - author varchar(255) default NULL, - note varchar(255) default NULL, - created timestamp(8) NOT NULL, - id int(10) unsigned NOT NULL auto_increment, - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'playlistitem' --- - -drop table if exists playlistitem; -CREATE TABLE playlistitem ( - playlist int(11) NOT NULL default '0', - tracknumber mediumint(9) NOT NULL default '0', - trackid int(11) default NULL, - PRIMARY KEY (playlist,tracknumber) -) TYPE=MyISAM; - --- --- Table structure for table 'playlog' --- - -drop table if exists playlog; -CREATE TABLE playlog ( - trackid int(11) default NULL, - played date default NULL, - id tinyint(3) unsigned NOT NULL auto_increment, - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'recordingitem' --- - -drop table if exists recordingitem; -CREATE TABLE recordingitem ( - trackid int(11) default NULL, - recdate date default NULL, - rectime time default NULL, - reclength int(11) default NULL, - enddate date default NULL, - endtime time default NULL, - repeat varchar(10) default NULL, - initcmd varchar(255) default NULL, - parameters varchar(255) default NULL, - atqjob int(11) default NULL, - id int(11) NOT NULL default '0', - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'source' --- - -drop table if exists source; -CREATE TABLE source ( - source varchar(40) default NULL, - id tinyint(3) unsigned NOT NULL auto_increment, - PRIMARY KEY (id) -) TYPE=MyISAM; - --- --- Table structure for table 'tracklistitem' --- - -drop table if exists tracklistitem; -CREATE TABLE tracklistitem ( - playerid int(11) NOT NULL default '0', - listtype smallint(6) NOT NULL default '0', - tracknb int(11) NOT NULL default '0', - trackid int(11) NOT NULL default '0', - PRIMARY KEY (playerid,listtype,tracknb) -) TYPE=MyISAM; - --- --- Table structure for table 'tracks' --- - -drop table if exists tracks; -CREATE TABLE tracks ( - artist varchar(255) default NULL, - title varchar(255) default NULL, - genre1 varchar(10) default NULL, - genre2 varchar(10) default NULL, - year smallint(5) unsigned default NULL, - lang varchar(4) default NULL, - type tinyint(3) unsigned default NULL, - rating tinyint(3) unsigned default NULL, - length smallint(5) unsigned default NULL, - source tinyint(3) unsigned default NULL, - sourceid varchar(20) default NULL, - tracknb tinyint(3) unsigned default NULL, - mp3file varchar(255) default NULL, - condition tinyint(3) unsigned default NULL, - voladjust smallint(6) default '0', - lengthfrm mediumint(9) default '0', - startfrm mediumint(9) default '0', - bpm smallint(6) default '0', - lyrics mediumtext, - bitrate varchar(10) default NULL, - created date default NULL, - modified date default NULL, - backup tinyint(3) unsigned default NULL, - - samplerate int(7) unsigned default NULL, - channels tinyint(3) unsigned default NULL, - - id int(11) NOT NULL auto_increment, - folder1 varchar(255), - folder2 varchar(255), - folder3 varchar(255), - folder4 varchar(255), - - PRIMARY KEY (id), - KEY title (title(10)), - KEY mp3file (mp3file(10)), - KEY genre1 (genre1), - KEY genre2 (genre2), - KEY year (year), - KEY lang (lang), - KEY type (type), - KEY rating (rating), - KEY sourceid (sourceid), - KEY artist (artist(10)) -) TYPE=MyISAM; - +-- NO LONGER NEEDED. +-- SEE README
\ No newline at end of file diff --git a/scripts/make-empty-db b/scripts/make-empty-db index 92ccf75..16c14c5 100755 --- a/scripts/make-empty-db +++ b/scripts/make-empty-db @@ -1,19 +1,4 @@ #!/bin/sh -echo "creating db" -mysql -u root < createdb.mysql - -echo "creating tables" -mysql -u root < createtables.mysql - -echo "reading genres" -echo " use GiantDisc; load data local infile 'genres.txt' into table genre;"| mysql -u root --local-infile=1 - -echo "reading languages" -echo "use GiantDisc; load data local infile 'languages.txt' into table language;" | mysql -u root --local-infile=1 - -echo "reading musictypes" -echo "use GiantDisc; load data local infile 'musictypes.txt' into table musictype;" | mysql -u root --local-infile=1 - -echo "reading sources" -echo "use GiantDisc; load data local infile 'sources.txt' into table source;" | mysql -u root --local-infile=1 +echo "THIS SCRIPT IS NO LONGER NEEDED." +echo "SEE THE README" diff --git a/vdr_setup.h b/vdr_setup.h index 354534f..6a8ebdb 100644 --- a/vdr_setup.h +++ b/vdr_setup.h @@ -26,7 +26,7 @@ /*! * \brief allow user to modify setup on OSD */ -class mgMenuSetup:public cMenuSetupPage +class mgMenuSetup : public cMenuSetupPage { private: mgSetup m_data; |