diff --git a/src/modules/authentication/bin/autogen.sh b/src/modules/authentication/bin/autogen.sh deleted file mode 100755 index ab010fe7d..000000000 --- a/src/modules/authentication/bin/autogen.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="Authentication" - -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -echo " aclocal $ACLOCAL_FLAGS" -cp -f ${configure_ac} ${tmpdir} -cp -f ${etcdir}/acinclude.m4 ${tmpdir} -aclocal $ACLOCAL_FLAGS - -echo " autoheader ${configure_ac}" -autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/modules/authentication/bin/gen_coverage_data.sh b/src/modules/authentication/bin/gen_coverage_data.sh deleted file mode 100755 index d3ed74d3b..000000000 --- a/src/modules/authentication/bin/gen_coverage_data.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script generates code coverage data for the module -#------------------------------------------------------------------------------- -module="Campcaster Authentication" - -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -docdir=$basedir/doc -tmpdir=$basedir/tmp - -usrdir=`cd $basedir/../../../usr; pwd;` - -coverage_report_dir=$docdir/coverage - -raw_coverage_file=$tmpdir/raw_coverage.info -coverage_file=$tmpdir/coverage.info - -lcov=$usrdir/bin/lcov -genhtml=$usrdir/bin/genhtml - - -cd $basedir - -#------------------------------------------------------------------------------- -# Re-configure with covarege collection enabled, compile and run the tests -#------------------------------------------------------------------------------- -$bindir/autogen.sh --enable-coverage -make clean -make check - -#------------------------------------------------------------------------------- -# Generate some symlinks so that the sources are visible from tmpdir -#------------------------------------------------------------------------------- -ln -s $basedir/include $tmpdir/include -ln -s $basedir/src $tmpdir/src - - -#------------------------------------------------------------------------------- -# Use lcov to generate an HTML report on the coverage data -#------------------------------------------------------------------------------- -$lcov -d $tmpdir -c > $raw_coverage_file -$lcov -e $raw_coverage_file "$tmpdir/*" > $coverage_file -rm -rf $coverage_report_dir -mkdir -p $coverage_report_dir -$genhtml -t "$module" -o $coverage_report_dir $coverage_file - - -#------------------------------------------------------------------------------- -# Clean up -#------------------------------------------------------------------------------- -rm -f $tmpdir/include -rm -f $tmpdir/src diff --git a/src/modules/authentication/configure b/src/modules/authentication/configure deleted file mode 100755 index abb0fa62e..000000000 --- a/src/modules/authentication/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen "$@") -fi - -(cd $tmpdir && $configure "$@") - diff --git a/src/modules/authentication/doc/.keepme b/src/modules/authentication/doc/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/authentication/doc/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/authentication/etc/Makefile.in b/src/modules/authentication/etc/Makefile.in deleted file mode 100644 index 4199c2f85..000000000 --- a/src/modules/authentication/etc/Makefile.in +++ /dev/null @@ -1,176 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# @configure_input@ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -CP = cp -f - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -BASE_DIR = @builddir@ -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -ETC_DIR = ${BASE_DIR}/etc -INCLUDE_DIR = ${BASE_DIR}/include -LIB_DIR = ${BASE_DIR}/lib -SRC_DIR = ${BASE_DIR}/src -TMP_DIR = ${BASE_DIR}/tmp - -prefix = @prefix@ - -USR_DIR = ${prefix} -USR_INCLUDE_DIR = ${USR_DIR}/include -USR_LIB_DIR = ${USR_DIR}/lib - -MODULES_DIR = ${BASE_DIR}/.. - -CORE_DIR = ${MODULES_DIR}/core -CORE_INCLUDE_DIR = ${CORE_DIR}/include -CORE_LIB_DIR = ${CORE_DIR}/lib -CORE_LIB = livesupport_core -CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a - -STORAGE_SERVER_DIR = ${MODULES_DIR}/storageServer - -VPATH = ${SRC_DIR} - -LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ -LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ - -TEST_RESULTS = ${DOC_DIR}/testResults.xml -# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR -TEST_XSLT = ../etc/testResultToHtml.xsl - -AUTHENTICATION_LIB = livesupport_authentication -AUTHENTICATION_LIB_FILE = ${LIB_DIR}/lib${AUTHENTICATION_LIB}.a -TEST_RUNNER = ${TMP_DIR}/testRunner - -DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config - -export LD_LIBRARY_PATH:=${USR_LIB_DIR}:${LD_LIBRARY_PATH} - - -#------------------------------------------------------------------------------- -# Configuration parameters -#------------------------------------------------------------------------------- -CPPFLAGS = @CPPFLAGS@ -CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ - -pedantic -Wall -Wno-long-long \ - ${LIBXMLPP_CFLAGS} \ - -I${USR_INCLUDE_DIR} \ - -I${CORE_INCLUDE_DIR} \ - -I${INCLUDE_DIR} -I${TMP_DIR} -LDFLAGS = @LDFLAGS@ -pthread \ - ${LIBXMLPP_LIBS} \ - -L${USR_LIB_DIR} \ - -L${CORE_LIB_DIR} \ - -L${LIB_DIR} - - -#------------------------------------------------------------------------------- -# Dependencies -#------------------------------------------------------------------------------- -AUTHENTICATION_LIB_OBJS = ${TMP_DIR}/AuthenticationClientFactory.o \ - ${TMP_DIR}/TestAuthenticationClient.o \ - ${TMP_DIR}/WebAuthenticationClient.o - -TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \ - ${TMP_DIR}/TestAuthenticationClientTest.o \ - ${TMP_DIR}/WebAuthenticationClientTest.o \ - ${TMP_DIR}/AuthenticationClientFactoryTest.o - -TEST_RUNNER_LIBS = -l${AUTHENTICATION_LIB} -l${CORE_LIB} \ - -lcppunit -ldl -lxmlrpc++ -lssl - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -.PHONY: all dir_setup doc clean docclean depclean distclean check install - -all: dir_setup ${AUTHENTICATION_LIB_FILE} - -dir_setup: ${TMP_DIR} ${DOXYGEN_DIR} - -doc: - ${DOXYGEN} ${DOXYGEN_CONFIG} - -clean: - ${RM} ${AUTHENTICATION_LIB_OBJS} ${AUTHENTICATION_LIB_FILE} - ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info - -docclean: - ${RMDIR} ${DOXYGEN_DIR}/html - ${RMDIR} ${COVERAGE_DIR}/* - ${RM} ${TEST_RESULTS} - -depclean: clean - -distclean: clean docclean - ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te* ${TMP_DIR}/ac*.m4 - -check: all ${TEST_RUNNER} - ${MAKE} -C ${STORAGE_SERVER_DIR} - ${TEST_RUNNER} -o ${TEST_RESULTS} -s ${TEST_XSLT} - -install: all - ${MKDIR} ${USR_INCLUDE_DIR}/LiveSupport/Authentication - ${CP} ${INCLUDE_DIR}/LiveSupport/Authentication/*.h \ - ${USR_INCLUDE_DIR}/LiveSupport/Authentication - ${CP} ${AUTHENTICATION_LIB_FILE} ${USR_LIB_DIR} - - -#------------------------------------------------------------------------------- -# Specific targets -#------------------------------------------------------------------------------- -${AUTHENTICATION_LIB_FILE}: ${AUTHENTICATION_LIB_OBJS} - ${AR} crus $@ $^ - -${TMP_DIR}: - ${MKDIR} ${TMP_DIR} - -${DOXYGEN_DIR}: - ${MKDIR} ${DOXYGEN_DIR} - -${TEST_RUNNER}: ${CORE_LIB_FILE} ${TEST_RUNNER_OBJS} ${AUTHENTICATION_LIB_FILE} - ${CXX} ${LDFLAGS} -o $@ ${TEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS} - -${CORE_LIB_FILE}: - ${MAKE} -C ${CORE_DIR} - - -#------------------------------------------------------------------------------- -# Pattern rules -#------------------------------------------------------------------------------- -${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx - ${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $< - diff --git a/src/modules/authentication/etc/acinclude.m4 b/src/modules/authentication/etc/acinclude.m4 deleted file mode 100644 index 83e8ed1c0..000000000 --- a/src/modules/authentication/etc/acinclude.m4 +++ /dev/null @@ -1,87 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl Macro to check for available modules using pkg-conf -dnl -dnl usage: -dnl PKG_CHECK_MODULES(GSTUFF,[gtk+-2.0 >= 1.3], action-if, action-not) -dnl -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -dnl -dnl This function was taken from the glade-- project -dnl----------------------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - diff --git a/src/modules/authentication/etc/authenticationClient.xml b/src/modules/authentication/etc/authenticationClient.xml deleted file mode 100644 index 7a1580f07..000000000 --- a/src/modules/authentication/etc/authenticationClient.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -]> - - - - - diff --git a/src/modules/authentication/etc/configure.ac b/src/modules/authentication/etc/configure.ac deleted file mode 100644 index 648a654e8..000000000 --- a/src/modules/authentication/etc/configure.ac +++ /dev/null @@ -1,104 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(Authentication, 0.0, support@sourcefabric.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../src/AuthenticationClientFactory.cxx) - -AC_CONFIG_HEADERS(configure.h) -AC_PROG_CXX() - -AC_CHECK_HEADERS(getopt.h) - - -dnl----------------------------------------------------------------------------- -dnl specify whether debug info should be compiled into the executable -dnl----------------------------------------------------------------------------- -AC_SUBST(CXXFLAGS) - -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [compile with debug info (no)]), - [], - [enable_debug=no]) - -if test "x${enable_debug}" = "xyes"; then - CXXFLAGS="-g -O0" - AC_DEFINE( YDEBUG, 1, [Debug is on] ) -else - CXXFLAGS="-O3" -fi - - -AC_MSG_RESULT([using compiler options: ${CXXFLAGS}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the pkg-config path -dnl----------------------------------------------------------------------------- -AC_ARG_WITH([pkg-config-path], - AC_HELP_STRING([--with-pkg-config-path], - [use the pkg-config path (prefix/lib/pkgconfig)]), - [PKG_CONFIG_PATH=${withval}], - [PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH]) - -AC_MSG_RESULT([using pkg-config path: ${PKG_CONFIG_PATH}]) - -export PKG_CONFIG_PATH - -export PATH=${prefix}/bin:${PATH} - - -PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.8.1]) -AC_SUBST(LIBXMLPP_CFLAGS) -AC_SUBST(LIBXMLPP_LIBS) - - -dnl----------------------------------------------------------------------------- -dnl enable compilaton for code coverage data -dnl----------------------------------------------------------------------------- -AC_SUBST(COVERAGE_CXXFLAGS) - -AC_ARG_ENABLE( coverage, -[ --enable-coverage enable code coverage data generaton (no) ], - ENABLE_COVERAGE=${enableval}, ENABLE_COVERAGE="no" ) - -if test "x${ENABLE_COVERAGE}" == "xyes" ; then - COVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage" - AC_MSG_RESULT([compiling in code coverage mode]) -else - AC_MSG_RESULT([not compiling in code coverage mode]) -fi - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() diff --git a/src/modules/authentication/etc/doxygen.config b/src/modules/authentication/etc/doxygen.config deleted file mode 100644 index 71bbba6e4..000000000 --- a/src/modules/authentication/etc/doxygen.config +++ /dev/null @@ -1,1140 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -# Doxyfile 1.3.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = Campcaster - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/doxygen - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = include src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/src/modules/authentication/etc/testAuthentication.xml b/src/modules/authentication/etc/testAuthentication.xml deleted file mode 100644 index 581498e59..000000000 --- a/src/modules/authentication/etc/testAuthentication.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -]> - - - diff --git a/src/modules/authentication/etc/webAuthentication.xml b/src/modules/authentication/etc/webAuthentication.xml deleted file mode 100644 index c10f709e7..000000000 --- a/src/modules/authentication/etc/webAuthentication.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -]> - - - diff --git a/src/modules/authentication/etc/webAuthentication.xml.template b/src/modules/authentication/etc/webAuthentication.xml.template deleted file mode 100644 index c5bd5dd13..000000000 --- a/src/modules/authentication/etc/webAuthentication.xml.template +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - -]> - - - diff --git a/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientFactory.h b/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientFactory.h deleted file mode 100644 index f960c244c..000000000 --- a/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientFactory.h +++ /dev/null @@ -1,187 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Authentication_AuthenticationClientFactory_h -#define LiveSupport_Authentication_AuthenticationClientFactory_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" - - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The factory to create AuthenticationClientInterface objects. - * - * This object has to be configured with an XML configuration element - * called authenticationClientFactory. This element contains a child element - * specifying and configuring the kind of AuthenticationClient that the - * factory builds. This client is either a TestAuthenticationClient or - * a WebAuthenticationClient, and the child element name is either - * testAuthentication or webAuthentication, correspondingly. - * - * An authenticationClientFactory configuration element may look like - * the following: - * - *

- *  <authenticationClientFactory>
- *      <webAuthentication>
- *          ...
- *      </webAuthentication>
- *  </authenticationClientFactory>
- *  
- * - * For detais of the testAuthentication and webAuthentication elements, see the - * documentation for the TestAuthenticationClient and WebAuthenticationClient - * classes. - * - * The DTD for the above element is: - * - *

- *  <!ELEMENT authenticationClientFactory (testAuthentication|
- *                                         webAuthentication) >
- *  
- * - * @see TestAuthenticationClient - * @see WebAuthenticationClient - */ -class AuthenticationClientFactory : - virtual public Configurable -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The authentication client created by this factory. - */ - Ptr::Ref authenticationClient; - - /** - * The default constructor. - */ - AuthenticationClientFactory(void) throw() - { - } - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~AuthenticationClientFactory(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Return an authentication client. - * - * @return the appropriate authentication client, according to the - * configuration of this factory. - */ - Ptr::Ref - getAuthenticationClient(void) throw () - { - return authenticationClient; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // LiveSupport_Authentication_AuthenticationClientFactory_h - diff --git a/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h b/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h deleted file mode 100644 index 855d2e381..000000000 --- a/src/modules/authentication/include/LiveSupport/Authentication/AuthenticationClientInterface.h +++ /dev/null @@ -1,231 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Authentication_AuthenticationClientInterface_h -#define LiveSupport_Authentication_AuthenticationClientInterface_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "LiveSupport/Core/XmlRpcInvalidArgumentException.h" -#include "LiveSupport/Core/XmlRpcCommunicationException.h" -#include "LiveSupport/Core/XmlRpcMethodFaultException.h" -#include "LiveSupport/Core/XmlRpcMethodResponseException.h" - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An interface for authentication clients. - */ -class AuthenticationClientInterface -{ - public: - - /** - * Return the version string from the storage. - * - * @return the version string of the storage. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - */ - virtual Ptr::Ref - getVersion(void) throw (XmlRpcException) - = 0; - - /** - * Login to the authentication server. - * Returns a new session ID; in case of an error, throws - * AuthenticationException or one of its subclasses. - * Note that an incorrect login or password is considered an error - * and will throw an XmlRpcException (in the case of WebStorageClient, - * an XmlRpcMethodFaultException, which is also an XmlRpcException). - * - * @param login the login to the server - * @param password the password to the server - * @exception XmlRpcCommunicationException problem with performing - * XML-RPC call - * @exception XmlRpcMethodFaultException XML-RPC method returned - * fault response - * @exception XmlRpcMethodResponseException response from XML-RPC - * method is incorrect - * @exception XmlRpcException other error - * (TestAuthenticationClient only) - * @return the new session ID - */ - virtual Ptr::Ref - login(const std::string &login, const std::string &password) - throw (XmlRpcException) - = 0; - - /** - * Logout from the authentication server. - * - * @param sessionId the ID of the session to end - * @exception XmlRpcCommunicationException problem with performing - * XML-RPC call - * @exception XmlRpcMethodFaultException XML-RPC method returned - * fault response - * @exception XmlRpcMethodResponseException response from XML-RPC - * method is incorrect - * @exception XmlRpcException other error - * (TestAuthenticationClient only) - */ - virtual void - logout(Ptr::Ref sessionId) - throw (XmlRpcException) - = 0; - - /** - * Load a `user preferences' item from the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * - * @exception std::invalid_argument - * no such preference key found - * @exception XmlRpcInvalidArgumentException - * bad sessionId argument - * @exception XmlRpcCommunicationException - * problem with performing XML-RPC call - * @exception XmlRpcMethodFaultException - * XML-RPC method returned fault response - * @exception XmlRpcMethodResponseException - * response from XML-RPC method is incorrect - * @exception XmlRpcException other error - * (TestAuthenticationClient only) - */ - virtual Ptr::Ref - loadPreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException, - std::invalid_argument) - = 0; - - /** - * Store a `user preferences' item on the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * @param value the (new) value of the item - * - * @exception XmlRpcInvalidArgumentException - * bad sessionId or value argument - * @exception XmlRpcCommunicationException - * problem with performing XML-RPC call - * @exception XmlRpcMethodFaultException - * XML-RPC method returned fault response - * @exception XmlRpcMethodResponseException - * response from XML-RPC method is incorrect - * @exception XmlRpcException other error - * (TestAuthenticationClient only) - */ - virtual void - savePreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key, - Ptr::Ref value) - throw (XmlRpcException) - = 0; - - /** - * Delete a `user preferences' item from the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * - * @exception XmlRpcInvalidArgumentException - * bad sessionId argument - * @exception XmlRpcCommunicationException - * problem with performing XML-RPC call - * @exception XmlRpcMethodFaultException - * XML-RPC method returned fault response - * @exception XmlRpcMethodResponseException - * response from XML-RPC method is incorrect - * @exception XmlRpcException other error - * (TestAuthenticationClient only) - */ - virtual void - deletePreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException) - = 0; - - /** - * Reset the authentication client. - * Invalidates all active session IDs, and resets the list of - * preferences to its initial (empty) state. - * - * @exception XmlRpcException if the server returns an error. - */ - virtual void - reset(void) - throw (XmlRpcException) - = 0; - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~AuthenticationClientInterface(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // LiveSupport_Authentication_AuthenticationClientInterface_h - diff --git a/src/modules/authentication/lib/.keepme b/src/modules/authentication/lib/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/authentication/lib/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/authentication/src/AuthenticationClientFactory.cxx b/src/modules/authentication/src/AuthenticationClientFactory.cxx deleted file mode 100644 index e8587af94..000000000 --- a/src/modules/authentication/src/AuthenticationClientFactory.cxx +++ /dev/null @@ -1,117 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "TestAuthenticationClient.h" -#include "WebAuthenticationClient.h" - -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string AuthenticationClientFactory::configElementNameStr = - "authenticationClientFactory"; - -/*------------------------------------------------------------------------------ - * The singleton instance of AuthenticationClientFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref AuthenticationClientFactory::singleton; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance to AuthenticationClientFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref -AuthenticationClientFactory :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new AuthenticationClientFactory()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the test authentication client. - *----------------------------------------------------------------------------*/ -void -AuthenticationClientFactory :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - authenticationClient.reset(); - - // try to look for a TestAuthenticationClient configuration element - xmlpp::Node::NodeList nodes = - element.get_children(TestAuthenticationClient::getConfigElementName()); - if (nodes.size() >= 1) { - const xmlpp::Element * configElement = - dynamic_cast (*(nodes.begin())); - Ptr::Ref tac(new TestAuthenticationClient()); - tac->configure(*configElement); - authenticationClient = tac; - return; - } - - // try to look for a WebAuthenticationClient configuration element - nodes = - element.get_children(WebAuthenticationClient::getConfigElementName()); - if (nodes.size() >= 1) { - const xmlpp::Element * configElement = - dynamic_cast (*(nodes.begin())); - Ptr::Ref wac(new WebAuthenticationClient()); - wac->configure(*configElement); - authenticationClient = wac; - return; - } - - throw std::invalid_argument("no authentication client configuration found"); -} - diff --git a/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx b/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx deleted file mode 100644 index 9d34755d9..000000000 --- a/src/modules/authentication/src/AuthenticationClientFactoryTest.cxx +++ /dev/null @@ -1,252 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Core/SessionId.h" -#include "AuthenticationClientFactoryTest.h" - - -using namespace std; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(AuthenticationClientFactoryTest); - -/** - * The name of the configuration file for the authentication client factory. - */ -static const std::string configFileName = "authenticationClient.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -AuthenticationClientFactoryTest :: setUp(void) throw () -{ - Ptr::Ref - acf = AuthenticationClientFactory::getInstance(); - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - configFileName); - const xmlpp::Element * root = document->get_root_node(); - - acf->configure(*root); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -AuthenticationClientFactoryTest :: tearDown(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can log on and off - *----------------------------------------------------------------------------*/ -void -AuthenticationClientFactoryTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref - acf = AuthenticationClientFactory::getInstance(); - Ptr::Ref - authentication = acf->getAuthenticationClient(); - - CPPUNIT_ASSERT_NO_THROW( - authentication->reset() - ); - - Ptr::Ref sessionId; - - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - CPPUNIT_ASSERT(sessionId); - - try { - authentication->logout(sessionId); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can save and load user preferences. - *----------------------------------------------------------------------------*/ -void -AuthenticationClientFactoryTest :: preferencesTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref - acf = AuthenticationClientFactory::getInstance(); - Ptr::Ref - authentication = acf->getAuthenticationClient(); - - CPPUNIT_ASSERT_NO_THROW( - authentication->reset() - ); - - Ptr::Ref sessionId; - Ptr::Ref prefValue; - - // check "please log in" error - try { - prefValue = authentication->loadPreferencesItem(sessionId, "something"); - CPPUNIT_FAIL("Allowed operation without login."); - } catch (XmlRpcException &e) { - } - - // log in - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // check "no such key" error - try { - prefValue = authentication->loadPreferencesItem(sessionId, "eye_color"); - CPPUNIT_FAIL("Retrieved non-existent user preferences item."); - } catch (std::invalid_argument &e) { - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // check normal save and load - prefValue.reset(new const Glib::ustring("chyornye")); - try { - authentication->savePreferencesItem(sessionId, "eye_color", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - Ptr::Ref newPrefValue; - try { - newPrefValue = authentication->loadPreferencesItem(sessionId, "eye_color"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == *prefValue); - - // try some unicode characters - prefValue.reset(new const Glib::ustring("страстные")); - try { - authentication->savePreferencesItem(sessionId, "eye_color", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = authentication->loadPreferencesItem(sessionId, "eye_color"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == "страстные"); - - // check another normal save and load... - prefValue.reset(new const Glib::ustring("ne dobryj")); - try { - authentication->savePreferencesItem(sessionId, "hour", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // ... but now change session ID in the middle - try { - authentication->logout(sessionId); - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = authentication->loadPreferencesItem(sessionId, "hour"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == *prefValue); - - // check the delete method - try { - authentication->deletePreferencesItem(sessionId, "hour"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = authentication->loadPreferencesItem(sessionId, "hour"); - CPPUNIT_FAIL("Allowed to load preference after it was deleted"); - } catch (std::invalid_argument &e) { - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // and log out - try { - authentication->logout(sessionId); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - diff --git a/src/modules/authentication/src/AuthenticationClientFactoryTest.h b/src/modules/authentication/src/AuthenticationClientFactoryTest.h deleted file mode 100644 index 086a54320..000000000 --- a/src/modules/authentication/src/AuthenticationClientFactoryTest.h +++ /dev/null @@ -1,113 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef AuthenticationClientFactoryTest_h -#define AuthenticationClientFactoryTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/BaseTestMethod.h" - -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the AuthenticationClientFactory class. - * - * @see AuthenticationClientFactory - */ -class AuthenticationClientFactoryTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(AuthenticationClientFactoryTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(preferencesTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test saving and load of user preferences. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - preferencesTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // AuthenticationClientFactoryTest_h - diff --git a/src/modules/authentication/src/TestAuthenticationClient.cxx b/src/modules/authentication/src/TestAuthenticationClient.cxx deleted file mode 100644 index fda964705..000000000 --- a/src/modules/authentication/src/TestAuthenticationClient.cxx +++ /dev/null @@ -1,294 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#include -#include -#include -#include - -#include "TestAuthenticationClient.h" - -using namespace boost::posix_time; -using namespace XmlRpc; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ configuration file constants */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string TestAuthenticationClient::configElementNameStr - = "testAuthentication"; - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the config child element for the login and password - *----------------------------------------------------------------------------*/ -const std::string userConfigElementName = "user"; - -/*------------------------------------------------------------------------------ - * The name of the config element attribute for the login - *----------------------------------------------------------------------------*/ -const std::string userLoginAttrName = "login"; - -/*------------------------------------------------------------------------------ - * The name of the config element attribute for the password - *----------------------------------------------------------------------------*/ -const std::string userPasswordAttrName = "password"; - -/*------------------------------------------------------------------------------ - * The dummy sessionId string returned by this authentication client - *----------------------------------------------------------------------------*/ -const std::string dummySessionIdString = "dummySessionId"; - -/*------------------------------------------------------------------------------ - * The version string, returned by getVersion - *----------------------------------------------------------------------------*/ -const std::string versionStr = "TestAuthentication"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the test storage client. - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClient :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - const xmlpp::Attribute * attribute = 0; - - // read the user data - xmlpp::Node::NodeList childNodes - = element.get_children(userConfigElementName); - xmlpp::Node::NodeList::iterator it = childNodes.begin(); - - if (it == childNodes.end()) { - std::string eMsg = "missing "; - eMsg += userConfigElementName; - eMsg += " XML element"; - throw std::invalid_argument(eMsg); - } - - const xmlpp::Element * userConfigElement - = dynamic_cast (*it); - if (!(attribute = userConfigElement - ->get_attribute(userLoginAttrName))) { - std::string eMsg = "missing attribute "; - eMsg += userLoginAttrName; - throw std::invalid_argument(eMsg); - } - userLogin = attribute->get_value(); - - if (!(attribute = userConfigElement - ->get_attribute(userPasswordAttrName))) { - std::string eMsg = "missing attribute "; - eMsg += userPasswordAttrName; - throw std::invalid_argument(eMsg); - } - userPassword = attribute->get_value(); - - ++it; - if (it != childNodes.end()) { - std::string eMsg = "more than one "; - eMsg += userConfigElementName; - eMsg += " XML element"; - throw std::invalid_argument(eMsg); - } - - versionString.reset(new Glib::ustring(versionStr)); - - sessionIdList.clear(); - sessionCounter = 0; -} - - -/*------------------------------------------------------------------------------ - * Return the version string of the test storage. - *----------------------------------------------------------------------------*/ -Ptr::Ref -TestAuthenticationClient :: getVersion(void) - throw (Core::XmlRpcException) -{ - return versionString; -} - - -/*------------------------------------------------------------------------------ - * Login to the authentication server. - *----------------------------------------------------------------------------*/ -Ptr::Ref -TestAuthenticationClient :: login(const std::string & login, - const std::string & password) - throw (XmlRpcException) -{ - Ptr::Ref sessionId; - - if (login == userLogin && password == userPassword) { - std::stringstream sessionIdStream; - sessionIdStream << dummySessionIdString - << sessionCounter++ - << '-' - << rand(); - sessionIdList.insert(sessionIdStream.str()); - sessionId.reset(new SessionId(sessionIdStream.str())); - return sessionId; - } else { - throw XmlRpcException("incorrect login or password"); - } -} - - -/*------------------------------------------------------------------------------ - * Logout from the authentication server. - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClient :: logout(Ptr::Ref sessionId) - throw (XmlRpcException) -{ - // this returns the number of entries found and erased - if (!sessionId || sessionIdList.erase(sessionId->getId())) { - return; - } else { - throw XmlRpcException("logout() called without previous login()"); - } -} - - -/*------------------------------------------------------------------------------ - * Load a `user preferences' item from the server. - *----------------------------------------------------------------------------*/ -Ptr::Ref -TestAuthenticationClient :: loadPreferencesItem( - Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException, - std::invalid_argument) -{ - if (!sessionId - || sessionIdList.find(sessionId->getId()) == sessionIdList.end()) { - throw XmlRpcException("bad session ID"); - } - - PreferencesType::iterator it; - - if ((it = preferences.find(key)) == preferences.end()) { - throw std::invalid_argument("no such user preferences item"); - } - - Ptr::Ref value(new Glib::ustring(*it->second)); - return value; -} - - -/*------------------------------------------------------------------------------ - * Store a `user preferences' item on the server. - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClient :: savePreferencesItem( - Ptr::Ref sessionId, - const Glib::ustring & key, - Ptr::Ref value) - throw (XmlRpcException) -{ - if (!sessionId - || sessionIdList.find(sessionId->getId()) == sessionIdList.end()) { - throw XmlRpcException("bad session ID"); - } - - if (sessionIdList.find(sessionId->getId()) == sessionIdList.end()) { - throw XmlRpcException("loadPreferences() called before login()"); - } - - preferences[key] = value; -} - - -/*------------------------------------------------------------------------------ - * Delete a `user preferences' item from the server. - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClient :: deletePreferencesItem( - Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException) -{ - if (!sessionId - || sessionIdList.find(sessionId->getId()) == sessionIdList.end()) { - throw XmlRpcException("bad session ID"); - } - - PreferencesType::iterator it; - - if ((it = preferences.find(key)) == preferences.end()) { - throw XmlRpcException("no such user preferences item"); - } - - preferences.erase(it); -} - - -/*------------------------------------------------------------------------------ - * Reset the list of preferences to its initial (empty) state. - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClient :: reset(void) - throw (XmlRpcException) -{ - sessionIdList.clear(); - sessionCounter = 0; - - preferences.clear(); -} - diff --git a/src/modules/authentication/src/TestAuthenticationClient.h b/src/modules/authentication/src/TestAuthenticationClient.h deleted file mode 100644 index c364123e3..000000000 --- a/src/modules/authentication/src/TestAuthenticationClient.h +++ /dev/null @@ -1,280 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef TestAuthenticationClient_h -#define TestAuthenticationClient_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" - - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A dummy authentication client. It only supports one user, whose name and - * password are read from a configuration file. It issues session IDs when - * login() is called, and deletes these session IDs when logout() is called. - * It also stores (key, value) pairs of user preferences for this one user. - * - * This object has to be configured with an XML configuration element - * called testAuthentication. This element contains a child element - * specifying the login and password. - * - * A testAuthentication configuration element may look like the following: - * - *

- *  <testAuthentication>
- *      <user
- *          login="root"
- *          password="q" 
- *      />
- *  </testAuthentication>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT testAuthentication (user) >
- *  <!ELEMENT user EMPTY >
- *  <!ATTLIST user login      CDATA      #REQUIRED >
- *  <!ATTLIST user password   CDATA      #REQUIRED >
- *  
- */ -class TestAuthenticationClient : - virtual public Configurable, - virtual public AuthenticationClientInterface -{ - private: - /** - * The name of the configuration XML elmenent used by - * TestAuthenticationClient - */ - static const std::string configElementNameStr; - - /** - * The version string of the test storage client. - */ - Ptr::Ref versionString; - - /** - * The login name of the (one) authorized test user. - */ - std::string userLogin; - - /** - * The password for the test user. - */ - std::string userPassword; - - /** - * A type for the list of sessionId's. - */ - typedef std::set - SessionIdListType; - - /** - * A list of the sessionId's we have issued. - */ - SessionIdListType sessionIdList; - - /** - * The number of the sessionId's we have issued. - */ - int sessionCounter; - - /** - * A type for the list of user preferences. - */ - typedef std::map::Ref> - PreferencesType; - - /** - * A list of the user preferences items stored. - */ - PreferencesType preferences; - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~TestAuthenticationClient(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the scheduler daemon has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument); - - /** - * Return the version string from the storage. - * - * @return the version string of the storage. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - */ - virtual Ptr::Ref - getVersion(void) throw (XmlRpcException); - - /** - * Login to the authentication server, using the data read from the - * configuration file. - * Returns a new session ID; in case of an error, returns a - * null pointer. - * Note that an incorrect login or password is considered an error - * and will throw an XmlRpcException. - * - * @return the new session ID - * @exception XmlRpcException login or password is incorrect - * (does not match those given in the configuration file) - */ - virtual Ptr::Ref - login(const std::string &login, const std::string &password) - throw (XmlRpcException); - - /** - * Logout from the authentication server. - * - * @param sessionId the ID of the session to end - * @exception XmlRpcException the sessionId does not match - * one issued by login() - */ - virtual void - logout(Ptr::Ref sessionId) - throw (XmlRpcException); - - /** - * Load a `user preferences' item from the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * @exception XmlRpcException invalid session ID - * @exception std::invalid_argument no such preference key found - */ - virtual Ptr::Ref - loadPreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException, - std::invalid_argument); - - /** - * Store a `user preferences' item on the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * @param value the (new) value of the item - * @exception XmlRpcException invalid session ID - */ - virtual void - savePreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key, - Ptr::Ref value) - throw (XmlRpcException); - - /** - * Delete a `user preferences' item from the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * @exception XmlRpcException invalid session ID, or no such key - */ - virtual void - deletePreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException); - - /** - * Reset the authentication client. - * Invalidates all active session IDs, and resets the list of - * preferences to its initial (empty) state. - * - * @exception XmlRpcException if the server returns an error. - */ - virtual void - reset(void) - throw (XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // TestAuthenticationClient_h - diff --git a/src/modules/authentication/src/TestAuthenticationClientTest.cxx b/src/modules/authentication/src/TestAuthenticationClientTest.cxx deleted file mode 100644 index 4a4eb6e70..000000000 --- a/src/modules/authentication/src/TestAuthenticationClientTest.cxx +++ /dev/null @@ -1,271 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Core/SessionId.h" -#include "TestAuthenticationClientTest.h" - - -using namespace std; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(TestAuthenticationClientTest); - -/** - * The name of the configuration file for the authentication client factory. - */ -static const std::string configFileName = "../etc/testAuthentication.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClientTest :: setUp(void) throw () -{ - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - configFileName); - const xmlpp::Element * root = document->get_root_node(); - - tac.reset(new TestAuthenticationClient()); - tac->configure(*root); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClientTest :: tearDown(void) throw () -{ - tac.reset(); -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can log on and off - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClientTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref sessionId; - - try { - sessionId = tac->login("Piszkos Fred", "malnaszor"); - CPPUNIT_FAIL("Allowed login with incorrect login and password."); - } catch (XmlRpcException &e) { - } - - // TODO: this call writes some garbage to cerr; it should be told not to - sessionId.reset(new SessionId("ceci n'est pas un session ID")); - try { - tac->logout(sessionId); - CPPUNIT_FAIL("Allowed logout without previous login."); - } catch (XmlRpcException &e) { - } - - try { - sessionId = tac->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - tac->logout(sessionId); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - tac->logout(sessionId); - CPPUNIT_FAIL("Allowed to logout twice."); - } catch (XmlRpcException &e) { - } -} - - -/*------------------------------------------------------------------------------ - * Test the getVersion function - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClientTest :: getVersionTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref version; - - try { - version = tac->getVersion(); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - CPPUNIT_ASSERT(version.get()); - CPPUNIT_ASSERT(*version == "TestAuthentication"); -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can save and load user preferences. - *----------------------------------------------------------------------------*/ -void -TestAuthenticationClientTest :: preferencesTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref sessionId; - Ptr::Ref prefValue; - - // check "please log in" error - try { - prefValue = tac->loadPreferencesItem(sessionId, "something"); - CPPUNIT_FAIL("Allowed operation without login."); - } catch (XmlRpcException &e) { - } - - // log in - try { - sessionId = tac->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // check "no such key" error - try { - prefValue = tac->loadPreferencesItem(sessionId, "eye_color"); - CPPUNIT_FAIL("Retrieved non-existent user preferences item."); - } catch (std::invalid_argument &e) { - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // check normal save and load - prefValue.reset(new const Glib::ustring("chyornye")); - try { - tac->savePreferencesItem(sessionId, "eye_color", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - Ptr::Ref newPrefValue; - try { - newPrefValue = tac->loadPreferencesItem(sessionId, "eye_color"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == *prefValue); - - // try some unicode characters - prefValue.reset(new const Glib::ustring("страстные")); - try { - tac->savePreferencesItem(sessionId, "eye_color", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = tac->loadPreferencesItem(sessionId, "eye_color"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == "страстные"); - - // check another normal save and load... - prefValue.reset(new const Glib::ustring("ne dobryj")); - try { - tac->savePreferencesItem(sessionId, "hour", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - - // ... but now change session ID in the middle - try { - tac->logout(sessionId); - sessionId = tac->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - try { - newPrefValue = tac->loadPreferencesItem(sessionId, "hour"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == *prefValue); - - // check the delete method - try { - tac->deletePreferencesItem(sessionId, "hour"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = tac->loadPreferencesItem(sessionId, "hour"); - CPPUNIT_FAIL("Allowed to load preference after it was deleted"); - } catch (std::invalid_argument &e) { - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // and log out - try { - tac->logout(sessionId); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} diff --git a/src/modules/authentication/src/TestAuthenticationClientTest.h b/src/modules/authentication/src/TestAuthenticationClientTest.h deleted file mode 100644 index 8e247fc94..000000000 --- a/src/modules/authentication/src/TestAuthenticationClientTest.h +++ /dev/null @@ -1,128 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef TestAuthenticationClientTest_h -#define TestAuthenticationClientTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/BaseTestMethod.h" - -#include "TestAuthenticationClient.h" - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the TestAuthenticationClient class. - * - * @see TestAuthenticationClient - */ -class TestAuthenticationClientTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(TestAuthenticationClientTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(getVersionTest); - CPPUNIT_TEST(preferencesTest); - CPPUNIT_TEST_SUITE_END(); - - private: - /** - * The TestAuthenticationClient instance to test. - */ - Ptr::Ref tac; - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test the gerVersion() function. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - getVersionTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test saving and load of user preferences. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - preferencesTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // TestAuthenticationClientTest_h - diff --git a/src/modules/authentication/src/TestRunner.cxx b/src/modules/authentication/src/TestRunner.cxx deleted file mode 100644 index 350009b57..000000000 --- a/src/modules/authentication/src/TestRunner.cxx +++ /dev/null @@ -1,276 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -using namespace LiveSupport::Core; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * Our copyright notice, should be at most 80 columns - */ -static const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -static const char options[] = "ho:s:v"; - -/** - * Structure describing the long options - */ -static const struct option longOptions[] = { - { "help", no_argument, 0, 'h' }, - { "output", required_argument, 0, 'o' }, - { "stylesheet", required_argument, 0, 's' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; - -/** - * The encoding to use for the output file. - */ -static const std::string encoding = "utf-8"; - -/** - * The output XML file name. - */ -static Ptr::Ref xmlOutFileName; - -/** - * The XSLT attached to the output file. - */ -static Ptr::Ref xsltFileName; - - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -static void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -static void -printUsage ( const char invocation[], - std::ostream & os ); - -/** - * Process command line arguments. - * - * @param argc the number of arguments. - * @param argv the arguments themselves. - * @return true of all went well, false in case the program should exit - * after this call. - */ -static bool -processArguments(int argc, char *argv[]); - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Run all tests - *----------------------------------------------------------------------------*/ -int -main( int argc, - char * argv[] ) throw () -{ - if (!processArguments(argc, argv)) { - return 0; - } - - // Create the event manager and test controller - CPPUNIT_NS::TestResult controller; - - // Add a listener that colllects test result - CPPUNIT_NS::TestResultCollector result; - controller.addListener( &result ); - - // Add a listener that print dots as test run. - CPPUNIT_NS::BriefTestProgressListener progress; - controller.addListener( &progress ); - - // Add the top suite to the test runner - CPPUNIT_NS::TestRunner runner; - runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); - runner.run( controller ); - - // Print test in a compiler compatible format. - CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr ); - outputter.setLocationFormat("%p:%l:"); - outputter.write(); - - // also generate an XML document as an output - std::ofstream xmlOutFile(xmlOutFileName->c_str()); - CPPUNIT_NS::XmlOutputter xmlOutputter(&result, xmlOutFile, encoding); - xmlOutputter.setStandalone(false); - if (xsltFileName) { - xmlOutputter.setStyleSheet(*xsltFileName); - } - xmlOutputter.write(); - xmlOutFile.flush(); - xmlOutFile.close(); - - return result.wasSuccessful() ? 0 : 1; -} - - -/*------------------------------------------------------------------------------ - * Process command line arguments. - *----------------------------------------------------------------------------*/ -static bool -processArguments(int argc, char *argv[]) -{ - int i; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'h': - printUsage(argv[0], std::cout); - return false; - - case 'o': - xmlOutFileName.reset(new std::string(optarg)); - break; - - case 's': - xsltFileName.reset(new std::string(optarg)); - break; - - case 'v': - printVersion(std::cout); - return false; - - default: - printUsage(argv[0], std::cout); - return false; - } - } - - if (optind < argc) { - std::cerr << "error processing command line arguments" << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - if (!xmlOutFileName) { - std::cerr << "mandatory option output file name not specified" - << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - std::cerr << "writing output to '" << *xmlOutFileName << '\'' << std::endl; - if (xsltFileName) { - std::cerr << "using XSLT file '" << *xsltFileName << '\'' << std::endl; - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -static void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -static void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION]" - << std::endl - << " mandatory options:" << std::endl - << " -o, --output=file.name write test results into this XML file" - << std::endl - << " optional options:" << std::endl - << " -s, --stylesheet specify this XSLT for the output file" - << std::endl - << " this is either an absolute URI, or a" - << std::endl - << " relative path for the output document" - << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/modules/authentication/src/WebAuthenticationClient.cxx b/src/modules/authentication/src/WebAuthenticationClient.cxx deleted file mode 100644 index 5f44deb0a..000000000 --- a/src/modules/authentication/src/WebAuthenticationClient.cxx +++ /dev/null @@ -1,658 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#include -#include -#include -#include - -#include "WebAuthenticationClient.h" - -using namespace boost::posix_time; -using namespace XmlRpc; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ configuration file constants */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string WebAuthenticationClient::configElementNameStr - = "webAuthentication"; - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the config child element for the authentication server location - *----------------------------------------------------------------------------*/ -const std::string locationConfigElementName = "location"; - -/*------------------------------------------------------------------------------ - * The name of the config element attribute for the server name - *----------------------------------------------------------------------------*/ -const std::string locationServerAttrName = "server"; - -/*------------------------------------------------------------------------------ - * The name of the config element attribute for the server port - *----------------------------------------------------------------------------*/ -const std::string locationPortAttrName = "port"; - -/*------------------------------------------------------------------------------ - * The name of the config element attribute for the server php page - *----------------------------------------------------------------------------*/ -const std::string locationPathAttrName = "path"; - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: login */ - -/*------------------------------------------------------------------------------ - * The name of the get version method on the storage server - *----------------------------------------------------------------------------*/ -const std::string getVersionMethodName = "locstor.getVersion"; - -/*------------------------------------------------------------------------------ - * The name of version return parameter for getVersion - *----------------------------------------------------------------------------*/ -const std::string getVersionResultParamName = "version"; - -/*------------------------------------------------------------------------------ - * The name of the login method on the server - *----------------------------------------------------------------------------*/ -const std::string loginMethodName = "locstor.login"; - -/*------------------------------------------------------------------------------ - * The name of the login parameter in the input structure - *----------------------------------------------------------------------------*/ -const std::string loginParamName = "login"; - -/*------------------------------------------------------------------------------ - * The name of the password parameter in the input structure - *----------------------------------------------------------------------------*/ -const std::string passwordParamName = "pass"; - -/*------------------------------------------------------------------------------ - * The name of the session ID parameter in the output structure - *----------------------------------------------------------------------------*/ -const std::string outputSessionIdParamName = "sessid"; - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: logout */ - -/*------------------------------------------------------------------------------ - * The name of the logout method on the server - *----------------------------------------------------------------------------*/ -const std::string logoutMethodName = "locstor.logout"; - -/*------------------------------------------------------------------------------ - * The name of the session ID parameter in the input structure - *----------------------------------------------------------------------------*/ -const std::string inputSessionIdParamName = "sessid"; - -/*------------------------------------------------------------------------------ - * The name of the status parameter in the output structure - *----------------------------------------------------------------------------*/ -const std::string statusParamName = "status"; - - -/* ~~~~~~~~~~~~~~~~~~ authentication server constants: load/save preferences */ - -/*------------------------------------------------------------------------------ - * The name of the load preferences method on the server - *----------------------------------------------------------------------------*/ -const std::string loadPreferencesMethodName = "locstor.loadPref"; - -/*------------------------------------------------------------------------------ - * The name of the save preferences method on the server - *----------------------------------------------------------------------------*/ -const std::string savePreferencesMethodName = "locstor.savePref"; - -/*------------------------------------------------------------------------------ - * The name of the delete preferences method on the server - *----------------------------------------------------------------------------*/ -const std::string deletePreferencesMethodName = "locstor.delPref"; - -/*------------------------------------------------------------------------------ - * The name of the session ID parameter in the input structure - *----------------------------------------------------------------------------*/ -const std::string preferencesSessionIdParamName = "sessid"; - -/*------------------------------------------------------------------------------ - * The name of the key parameter in the input structure - *----------------------------------------------------------------------------*/ -const std::string preferencesKeyParamName = "key"; - -/*------------------------------------------------------------------------------ - * The name of the value parameter for both save and load methods - *----------------------------------------------------------------------------*/ -const std::string preferencesValueParamName = "value"; - -/*------------------------------------------------------------------------------ - * The name of the return parameter for the save method - *----------------------------------------------------------------------------*/ -const std::string preferencesStatusParamName = "status"; - -/*------------------------------------------------------------------------------ - * The name of the fault code parameter - *----------------------------------------------------------------------------*/ -const std::string faultCodeParamName = "faultCode"; - -/*------------------------------------------------------------------------------ - * The fault code for the "invalid preference key" error - *----------------------------------------------------------------------------*/ -const int invalidPreferenceKeyFaultCode = 849; - - -/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~ authentication server constants: resetStorage */ - -/*------------------------------------------------------------------------------ - * The name of the reset storage method on the server - *----------------------------------------------------------------------------*/ -const std::string resetStorageMethodName = "locstor.resetStorage"; - -/*------------------------------------------------------------------------------ - * The name of the result parameter returned by the method (ignored here) - *----------------------------------------------------------------------------*/ -const std::string resetStorageResultParamName = "results"; - -/*------------------------------------------------------------------------------ - * The name of the count parameter returned by the method (ignored here) - *----------------------------------------------------------------------------*/ -const std::string resetStorageCountParamName = "cnt"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the web storage client. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClient :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - const xmlpp::Attribute * attribute = 0; - - // read the storage server location - xmlpp::Node::NodeList childNodes - = element.get_children(locationConfigElementName); - xmlpp::Node::NodeList::iterator it = childNodes.begin(); - - if (it == childNodes.end()) { - std::string eMsg = "missing "; - eMsg += locationConfigElementName; - eMsg += " XML element"; - throw std::invalid_argument(eMsg); - } - - const xmlpp::Element * locationConfigElement - = dynamic_cast (*it); - if (!(attribute = locationConfigElement - ->get_attribute(locationServerAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += locationServerAttrName; - throw std::invalid_argument(eMsg); - } - storageServerName = attribute->get_value(); - - if (!(attribute = locationConfigElement - ->get_attribute(locationPortAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += locationPortAttrName; - throw std::invalid_argument(eMsg); - } - std::stringstream storageServerPortValue(attribute->get_value()); - storageServerPortValue >> storageServerPort; - - if (!(attribute = locationConfigElement - ->get_attribute(locationPathAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += locationPathAttrName; - throw std::invalid_argument(eMsg); - } - storageServerPath = attribute->get_value(); - - ++it; - if (it != childNodes.end()) { - std::string eMsg = "more than one "; - eMsg += locationConfigElementName; - eMsg += " XML element"; - throw std::invalid_argument(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Return the version string of the test storage. - *----------------------------------------------------------------------------*/ -Ptr::Ref -WebAuthenticationClient :: getVersion(void) - throw (Core::XmlRpcException) -{ - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - // add a dummy parameter, as this is the only way to enforce parameters - // to be of XML-RPC type struct - parameters["dummy"] = 0; - result.clear(); - if (!xmlRpcClient.execute(getVersionMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - std::string eMsg = "cannot execute XML-RPC method '"; - eMsg += getVersionMethodName; - eMsg += "'"; - throw XmlRpcCommunicationException(eMsg); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << getVersionMethodName - << "' returned error message:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (!result.hasMember(getVersionResultParamName) - || result[getVersionResultParamName].getType() - != XmlRpcValue::TypeString) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << getVersionMethodName - << "' returned unexpected value:\n" - << result; - throw XmlRpcMethodResponseException(eMsg.str()); - } - - Ptr::Ref version(new Glib::ustring( - result[getVersionResultParamName])); - - xmlRpcClient.close(); - - return version; -} - - -/*------------------------------------------------------------------------------ - * Login to the authentication server. - *----------------------------------------------------------------------------*/ -Ptr::Ref -WebAuthenticationClient :: login(const std::string & login, - const std::string & password) - throw (XmlRpcException) -{ - XmlRpcValue parameters; - XmlRpcValue result; - Ptr::Ref sessionId; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[loginParamName] = login; - parameters[passwordParamName] = password; - - result.clear(); - if (!xmlRpcClient.execute(loginMethodName.c_str(), parameters, result)) { - xmlRpcClient.close(); - throw Authentication::XmlRpcCommunicationException("Login failed."); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "Login method returned fault response:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(outputSessionIdParamName)) { - std::stringstream eMsg; - eMsg << "Login method returned unexpected response:\n" - << result; - throw Core::XmlRpcMethodResponseException(eMsg.str()); - } - - if (result[outputSessionIdParamName].getType() != XmlRpcValue::TypeString) { - std::stringstream eMsg; - eMsg << "Login method returned unexpected response:\n" - << result; - throw Core::XmlRpcMethodResponseException(eMsg.str()); - } - - sessionId.reset(new SessionId(result[outputSessionIdParamName])); - return sessionId; -} - - -/*------------------------------------------------------------------------------ - * Logout from the authentication server. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClient :: logout(Ptr::Ref sessionId) - throw (XmlRpcException) -{ - if (!sessionId) { - throw Core::XmlRpcInvalidArgumentException("Missing session ID."); - } - - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[inputSessionIdParamName] = sessionId->getId(); - - result.clear(); - if (!xmlRpcClient.execute(logoutMethodName.c_str(), parameters, result)) { - xmlRpcClient.close(); - throw Core::XmlRpcCommunicationException("Logout failed."); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "Logout method returned fault response:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(statusParamName) - || result[statusParamName].getType() != XmlRpcValue::TypeBoolean - || ! bool(result[statusParamName])) { - std::stringstream eMsg; - eMsg << "Logout method returned unexpected response:\n" - << result; - throw Core::XmlRpcMethodResponseException(eMsg.str()); - } -} - - -/*------------------------------------------------------------------------------ - * Load a `user preferences' item from the server. - *----------------------------------------------------------------------------*/ -Ptr::Ref -WebAuthenticationClient :: loadPreferencesItem( - Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException, - std::invalid_argument) -{ - if (!sessionId) { - throw Core::XmlRpcInvalidArgumentException("Missing session ID."); - } - - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[preferencesSessionIdParamName] = sessionId->getId(); - parameters[preferencesKeyParamName] = std::string(key); - - result.clear(); - if (!xmlRpcClient.execute(loadPreferencesMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - throw Core::XmlRpcCommunicationException( - "Could not execute XML-RPC method."); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method " - << loadPreferencesMethodName - << " returned fault response:\n" - << result; - if (result.hasMember(faultCodeParamName) - && result[faultCodeParamName].getType() - == XmlRpcValue::TypeInt - && int(result[faultCodeParamName]) - == invalidPreferenceKeyFaultCode) { - throw std::invalid_argument(eMsg.str()); - } else { - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - } - - if (! result.hasMember(preferencesValueParamName) - || result[preferencesValueParamName].getType() - != XmlRpcValue::TypeString) { - std::stringstream eMsg; - eMsg << "XML-RPC method " - << loadPreferencesMethodName - << " returned unexpected response:\n" - << result; - throw Core::XmlRpcMethodResponseException(eMsg.str()); - } - - Ptr::Ref value(new Glib::ustring(std::string( - result[preferencesValueParamName] ))); - return value; -} - - -/*------------------------------------------------------------------------------ - * Store a `user preferences' item on the server. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClient :: savePreferencesItem( - Ptr::Ref sessionId, - const Glib::ustring & key, - Ptr::Ref value) - throw (XmlRpcException) -{ - if (!sessionId) { - throw Core::XmlRpcInvalidArgumentException("Missing session ID."); - } - - if (!value) { - throw Core::XmlRpcInvalidArgumentException("Missing value argument."); - } - - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[preferencesSessionIdParamName] = sessionId->getId(); - parameters[preferencesKeyParamName] = std::string(key); - parameters[preferencesValueParamName] = std::string(*value); - - result.clear(); - if (!xmlRpcClient.execute(savePreferencesMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - throw Core::XmlRpcCommunicationException( - "Could not execute XML-RPC method."); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method " - << savePreferencesMethodName - << " returned fault response:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(preferencesStatusParamName) - || result[preferencesStatusParamName].getType() - != XmlRpcValue::TypeBoolean - || ! bool(result[preferencesStatusParamName])) { - std::stringstream eMsg; - eMsg << "XML-RPC method " - << savePreferencesMethodName - << " returned unexpected response:\n" - << result; - throw Core::XmlRpcMethodResponseException(eMsg.str()); - } -} - - -/*------------------------------------------------------------------------------ - * Delete a `user preferences' item from the server. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClient :: deletePreferencesItem( - Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException) -{ - if (!sessionId) { - throw Core::XmlRpcInvalidArgumentException("Missing session ID."); - } - - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters[preferencesSessionIdParamName] = sessionId->getId(); - parameters[preferencesKeyParamName] = std::string(key); - - result.clear(); - if (!xmlRpcClient.execute(deletePreferencesMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - throw Core::XmlRpcCommunicationException( - "Could not execute XML-RPC method."); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method " - << deletePreferencesMethodName - << " returned fault response:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(preferencesStatusParamName) - || result[preferencesStatusParamName].getType() - != XmlRpcValue::TypeBoolean - || ! bool(result[preferencesStatusParamName])) { - std::stringstream eMsg; - eMsg << "XML-RPC method " - << deletePreferencesMethodName - << " returned unexpected response:\n" - << result; - throw Core::XmlRpcMethodResponseException(eMsg.str()); - } -} - - -/*------------------------------------------------------------------------------ - * Reset the list of preferences to its initial (empty) state. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClient :: reset(void) - throw (Core::XmlRpcException) -{ - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpcClient xmlRpcClient(storageServerName.c_str(), storageServerPort, - storageServerPath.c_str(), false); - - parameters.clear(); - parameters["dummy_param"] = "dummy_value"; - - result.clear(); - if (!xmlRpcClient.execute(resetStorageMethodName.c_str(), - parameters, result)) { - xmlRpcClient.close(); - throw Core::XmlRpcCommunicationException( - "Could not execute XML-RPC method."); - } - xmlRpcClient.close(); - - if (xmlRpcClient.isFault()) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << resetStorageMethodName - << "' returned error message:\n" - << result; - throw Core::XmlRpcMethodFaultException(eMsg.str()); - } - - if (! result.hasMember(resetStorageResultParamName) - || result[resetStorageResultParamName].getType() - != XmlRpcValue::TypeArray - || ! result.hasMember(resetStorageCountParamName) - || result[resetStorageCountParamName].getType() - != XmlRpcValue::TypeInt) { - std::stringstream eMsg; - eMsg << "XML-RPC method '" - << resetStorageMethodName - << "' returned unexpected value:\n" - << result; - throw XmlRpcMethodResponseException(eMsg.str()); - } -} - diff --git a/src/modules/authentication/src/WebAuthenticationClient.h b/src/modules/authentication/src/WebAuthenticationClient.h deleted file mode 100644 index 24980fced..000000000 --- a/src/modules/authentication/src/WebAuthenticationClient.h +++ /dev/null @@ -1,289 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef WebAuthenticationClient_h -#define WebAuthenticationClient_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" - - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An interface to the authentication methods on the php authentication - * server (which is currently the same as the storage server). - * - * This object has to be configured with an XML configuration element - * called webAuthentication. This element contains a child element - * specifying the location of the authentication server. - * - * A webAuthentication configuration element may look like the following: - * - *

- *  <webAuthentication>
- *      <location
- *          server="localhost"
- *          port="80" 
- *          path="/livesupportStorageServer/xmlrpc/xrLocStor.php"
- *      />
- *  </webAuthentication>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT webAuthentication (location) >
- *  <!ELEMENT location EMPTY >
- *  <!ATTLIST location server   CDATA       #REQUIRED >
- *  <!ATTLIST location port     NMTOKEN     #REQUIRED >
- *  <!ATTLIST location path     CDATA       #REQUIRED >
- *  
- */ -class WebAuthenticationClient : - virtual public Configurable, - virtual public AuthenticationClientInterface -{ - private: - /** - * The name of the configuration XML elmenent used by - * WebAuthenticationClient - */ - static const std::string configElementNameStr; - - /** - * The name of the authentication server, e.g. - * "myserver.mycompany.com". - */ - std::string storageServerName; - - /** - * The port wher the authentication server is listening - * (default is 80). - */ - int storageServerPort; - - /** - * The path to the authentication server php page. - */ - std::string storageServerPath; - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~WebAuthenticationClient(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the scheduler daemon has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument); - - /** - * Return the version string from the storage. - * - * @return the version string of the storage. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - */ - virtual Ptr::Ref - getVersion(void) throw (XmlRpcException); - - /** - * Login to the authentication server, using the data read from the - * configuration file. - * Returns a new session ID; in case of an error, throws one of three - * types of AuthenticationException. - * Note that an incorrect login or password is considered an error - * and will throw an XmlRpcMethodFaultException. - * - * @param login the login to the server - * @param password the password to the server - * @exception XmlRpcCommunicationException problem with performing - * XML-RPC call - * @exception XmlRpcMethodFaultException XML-RPC method returned - * fault response - * @exception XmlRpcMethodResponseException response from XML-RPC - * method is incorrect - * @return the new session ID - */ - virtual Ptr::Ref - login(const std::string &login, const std::string &password) - throw (XmlRpcException); - - /** - * Logout from the authentication server. - * - * @param sessionId the ID of the session to end - * @exception XmlRpcCommunicationException problem with performing - * XML-RPC call - * @exception XmlRpcMethodFaultException XML-RPC method returned - * fault response - * @exception XmlRpcMethodResponseException response from XML-RPC - * method is incorrect - * @return true if logged out successfully, false if not - */ - virtual void - logout(Ptr::Ref sessionId) - throw (XmlRpcException); - - /** - * Load a `user preferences' item from the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * - * @exception std::invalid_argument - * no such preference key found - * @exception XmlRpcInvalidArgumentException - * bad sessionId argument - * @exception XmlRpcCommunicationException - * problem with performing XML-RPC call - * @exception XmlRpcMethodFaultException - * XML-RPC method returned fault response - * @exception XmlRpcMethodResponseException - * response from XML-RPC method is incorrect - */ - virtual Ptr::Ref - loadPreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException, - std::invalid_argument); - - /** - * Store a `user preferences' item on the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * @param value the (new) value of the item - * - * @exception XmlRpcInvalidArgumentException - * bad sessionId or value argument - * @exception XmlRpcCommunicationException - * problem with performing XML-RPC call - * @exception XmlRpcMethodFaultException - * XML-RPC method returned fault response - * @exception XmlRpcMethodResponseException - * response from XML-RPC method is incorrect - */ - virtual void - savePreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key, - Ptr::Ref value) - throw (XmlRpcException); - - /** - * Delete a `user preferences' item from the server. - * - * @param sessionId the ID of the current session (from login()) - * @param key the name of the item - * - * @exception XmlRpcInvalidArgumentException - * bad sessionId argument - * @exception XmlRpcCommunicationException - * problem with performing XML-RPC call - * @exception XmlRpcMethodFaultException - * XML-RPC method returned fault response - * @exception XmlRpcMethodResponseException - * response from XML-RPC method is incorrect - */ - virtual void - deletePreferencesItem(Ptr::Ref sessionId, - const Glib::ustring & key) - throw (XmlRpcException); - - /** - * Reset the authentication client. - * Invalidates all active session IDs, and resets the list of - * preferences to its initial (empty) state. - * - * @exception XmlRpcException if the server returns an error. - */ - virtual void - reset(void) - throw (XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // WebAuthenticationClient_h - diff --git a/src/modules/authentication/src/WebAuthenticationClientTest.cxx b/src/modules/authentication/src/WebAuthenticationClientTest.cxx deleted file mode 100644 index 8f978ffe4..000000000 --- a/src/modules/authentication/src/WebAuthenticationClientTest.cxx +++ /dev/null @@ -1,276 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Core/SessionId.h" -#include "WebAuthenticationClientTest.h" - - -using namespace std; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(WebAuthenticationClientTest); - -/** - * The name of the configuration file for the authentication client factory. - */ -static const std::string configFileName = "webAuthentication.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClientTest :: setUp(void) throw () -{ - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - configFileName); - const xmlpp::Element * root = document->get_root_node(); - - wac.reset(new WebAuthenticationClient()); - wac->configure(*root); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClientTest :: tearDown(void) throw () -{ - wac.reset(); -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can log on and off. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClientTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref sessionId; - - try { - sessionId = wac->login("Piszkos Fred", "malnaszor"); - CPPUNIT_FAIL("Allowed login with incorrect login and password."); - } catch (XmlRpcException &e) { - } - - sessionId.reset(new SessionId("bad_session_ID")); - try { - wac->logout(sessionId); - CPPUNIT_FAIL("Allowed logout without previous login."); - } catch (XmlRpcException &e) { - } - - try { - sessionId = wac->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - wac->logout(sessionId); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - wac->logout(sessionId); - CPPUNIT_FAIL("Allowed to logout twice."); - } catch (XmlRpcException &e) { - } -} - - -/*------------------------------------------------------------------------------ - * Test the getVersion function - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClientTest :: getVersionTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref version; - - try { - version = wac->getVersion(); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - CPPUNIT_ASSERT(version.get()); -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can save and load user preferences. - *----------------------------------------------------------------------------*/ -void -WebAuthenticationClientTest :: preferencesTest(void) - throw (CPPUNIT_NS::Exception) -{ - try { - wac->reset(); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - Ptr::Ref sessionId; - Ptr::Ref prefValue; - - // check "please log in" error - try { - prefValue = wac->loadPreferencesItem(sessionId, "something"); - CPPUNIT_FAIL("Allowed operation without login."); - } catch (XmlRpcException &e) { - } - - // log in - try { - sessionId = wac->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // check "no such key" error - try { - prefValue = wac->loadPreferencesItem(sessionId, "eye_color"); - CPPUNIT_FAIL("Retrieved non-existent user preferences item"); - } catch (std::invalid_argument &e) { - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // check normal save and load - prefValue.reset(new const Glib::ustring("chjornyje")); - try { - wac->savePreferencesItem(sessionId, "eye_color", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - Ptr::Ref newPrefValue; - try { - newPrefValue = wac->loadPreferencesItem(sessionId, "eye_color"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == *prefValue); - - // try some unicode characters - prefValue.reset(new const Glib::ustring("страстные")); - try { - wac->savePreferencesItem(sessionId, "eye_color", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = wac->loadPreferencesItem(sessionId, "eye_color"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == "страстные"); - - // check another normal save and load ... - prefValue.reset(new const Glib::ustring("ne dobryj")); - try { - wac->savePreferencesItem(sessionId, "hour", prefValue); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // ... but now change session ID in the middle - try { - wac->logout(sessionId); - sessionId = wac->login("root", "q"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = wac->loadPreferencesItem(sessionId, "hour"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - CPPUNIT_ASSERT(*newPrefValue == *prefValue); - - // check the delete method - try { - wac->deletePreferencesItem(sessionId, "hour"); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - try { - newPrefValue = wac->loadPreferencesItem(sessionId, "hour"); - CPPUNIT_FAIL("Allowed to load preference after it was deleted"); - } catch (std::invalid_argument &e) { - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - // and log out - try { - wac->logout(sessionId); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - diff --git a/src/modules/authentication/src/WebAuthenticationClientTest.h b/src/modules/authentication/src/WebAuthenticationClientTest.h deleted file mode 100644 index 08c90aa4a..000000000 --- a/src/modules/authentication/src/WebAuthenticationClientTest.h +++ /dev/null @@ -1,128 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef WebAuthenticationClientTest_h -#define WebAuthenticationClientTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/BaseTestMethod.h" - -#include "WebAuthenticationClient.h" - -namespace LiveSupport { -namespace Authentication { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the WebAuthenticationClient class. - * - * @see WebAuthenticationClient - */ -class WebAuthenticationClientTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(WebAuthenticationClientTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(getVersionTest); - CPPUNIT_TEST(preferencesTest); - CPPUNIT_TEST_SUITE_END(); - - private: - /** - * The WebAuthenticationClient instance to test. - */ - Ptr::Ref wac; - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test the getVersion() function. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - getVersionTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test saving and load of user preferences. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - preferencesTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Authentication -} // namespace LiveSupport - -#endif // WebAuthenticationClientTest_h - diff --git a/src/modules/authentication/tmp/.keepme b/src/modules/authentication/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/authentication/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/db/bin/autogen.sh b/src/modules/db/bin/autogen.sh deleted file mode 100755 index 57044e4a6..000000000 --- a/src/modules/db/bin/autogen.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="Db" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -echo " aclocal $ACLOCAL_FLAGS" -cp -f ${configure_ac} ${tmpdir} -cp -f ${etcdir}/acinclude.m4 ${tmpdir} -aclocal $ACLOCAL_FLAGS - -echo " autoheader ${configure_ac}" -autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/modules/db/bin/gen_coverage_data.sh b/src/modules/db/bin/gen_coverage_data.sh deleted file mode 100755 index c8a4606a5..000000000 --- a/src/modules/db/bin/gen_coverage_data.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script generates code coverage data for the module -#------------------------------------------------------------------------------- -module="Campcaster Db" - -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -docdir=$basedir/doc -tmpdir=$basedir/tmp - -usrdir=`cd $basedir/../../../usr; pwd;` - -coverage_report_dir=$docdir/coverage - -raw_coverage_file=$tmpdir/raw_coverage.info -coverage_file=$tmpdir/coverage.info - -lcov=$usrdir/bin/lcov -genhtml=$usrdir/bin/genhtml - - -cd $basedir - -#------------------------------------------------------------------------------- -# Re-configure with covarege collection enabled, compile and run the tests -#------------------------------------------------------------------------------- -$bindir/autogen.sh --enable-coverage -make clean -make check - -#------------------------------------------------------------------------------- -# Generate some symlinks so that the sources are visible from tmpdir -#------------------------------------------------------------------------------- -ln -s $basedir/include $tmpdir/include -ln -s $basedir/src $tmpdir/src - - -#------------------------------------------------------------------------------- -# Use lcov to generate an HTML report on the coverage data -#------------------------------------------------------------------------------- -$lcov -d $tmpdir -c > $raw_coverage_file -$lcov -e $raw_coverage_file "$tmpdir/*" > $coverage_file -rm -rf $coverage_report_dir -mkdir -p $coverage_report_dir -$genhtml -t "$module" -o $coverage_report_dir $coverage_file - - -#------------------------------------------------------------------------------- -# Clean up -#------------------------------------------------------------------------------- -rm -f $tmpdir/include -rm -f $tmpdir/src diff --git a/src/modules/db/configure b/src/modules/db/configure deleted file mode 100755 index 0c58cc366..000000000 --- a/src/modules/db/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen "$@") -fi - -(cd $tmpdir && $configure "$@") - diff --git a/src/modules/db/doc/doxygen/.keepme b/src/modules/db/doc/doxygen/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/db/doc/doxygen/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/db/etc/Makefile.in b/src/modules/db/etc/Makefile.in deleted file mode 100644 index 1564d01eb..000000000 --- a/src/modules/db/etc/Makefile.in +++ /dev/null @@ -1,174 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# @configure_input@ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -CP = cp -f - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -BASE_DIR = @builddir@ -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -BIN_DIR = ${BASE_DIR}/bin -ETC_DIR = ${BASE_DIR}/etc -INCLUDE_DIR = ${BASE_DIR}/include -LIB_DIR = ${BASE_DIR}/lib -SRC_DIR = ${BASE_DIR}/src -TMP_DIR = ${BASE_DIR}/tmp - -prefix = @prefix@ - -USR_DIR = ${prefix} -USR_INCLUDE_DIR = ${USR_DIR}/include -USR_LIB_DIR = ${USR_DIR}/lib - -MODULES_DIR = ${BASE_DIR}/.. - -CORE_DIR = ${MODULES_DIR}/core -CORE_INCLUDE_DIR = ${CORE_DIR}/include -CORE_LIB_DIR = ${CORE_DIR}/lib -CORE_LIB = livesupport_core -CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a - -VPATH = ${SRC_DIR} - -LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ -LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ -LIBODBCXX_CFLAGS=@LIBODBCXX_CFLAGS@ -LIBODBCXX_LIBS=@LIBODBCXX_LIBS@ - -TEST_RESULTS = ${DOC_DIR}/testResults.xml -# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR -TEST_XSLT = ../etc/testResultToHtml.xsl - -DB_LIB = livesupport_db -DB_LIB_FILE = ${LIB_DIR}/lib${DB_LIB}.a -TEST_RUNNER = ${TMP_DIR}/testRunner - -DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config - -export LD_LIBRARY_PATH:=${LD_LIBRARY_PATH}:${USR_LIB_DIR} - - -#------------------------------------------------------------------------------- -# Configuration parameters -#------------------------------------------------------------------------------- -CPPFLAGS = @CPPFLAGS@ -CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ - -pedantic -Wall -Wno-long-long \ - ${LIBXMLPP_CFLAGS} \ - ${LIBODBCXX_CFLAGS} \ - -I${USR_INCLUDE_DIR} \ - -I${CORE_INCLUDE_DIR} \ - -I${INCLUDE_DIR} -I${TMP_DIR} -LDFLAGS = @LDFLAGS@ -pthread \ - ${LIBXMLPP_LIBS} \ - ${LIBODBCXX_LIBS} \ - -L${USR_LIB_DIR} \ - -L${CORE_LIB_DIR} \ - -L${LIB_DIR} - - -#------------------------------------------------------------------------------- -# Dependencies -#------------------------------------------------------------------------------- -DB_LIB_OBJS = ${TMP_DIR}/SimpleConnectionManager.o \ - ${TMP_DIR}/ConnectionManagerFactory.o \ - ${TMP_DIR}/Conversion.o -TEST_RUNNER_OBJS = ${TMP_DIR}/TestRunner.o \ - ${TMP_DIR}/SimpleConnectionManagerTest.o \ - ${TMP_DIR}/ConnectionManagerFactoryTest.o -TEST_RUNNER_LIBS = -l${DB_LIB} -l${CORE_LIB} -lcppunit -ldl - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -.PHONY: all dir_setup doc clean docclean depclean distclean check install - -all: dir_setup ${DB_LIB_FILE} - -dir_setup: ${TMP_DIR} ${DOXYGEN_DIR} - -doc: - ${DOXYGEN} ${DOXYGEN_CONFIG} - -clean: - ${RM} ${DB_LIB_OBJS} ${DB_LIB_FILE} - ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info - -docclean: - ${RMDIR} ${DOXYGEN_DIR}/html - ${RMDIR} ${COVERAGE_DIR}/* - ${RM} ${TEST_RESULTS} - -depclean: clean - -distclean: clean docclean - ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te* ${TMP_DIR}/ac*.m4 - -check: all ${TEST_RUNNER} - ${TEST_RUNNER} -o ${TEST_RESULTS} -s ${TEST_XSLT} - -install: all - ${MKDIR} ${USR_INCLUDE_DIR}/LiveSupport/Db - ${CP} ${INCLUDE_DIR}/LiveSupport/Db/*.h \ - ${USR_INCLUDE_DIR}/LiveSupport/Db - ${CP} ${DB_LIB_FILE} ${USR_LIB_DIR} - - -#------------------------------------------------------------------------------- -# Specific targets -#------------------------------------------------------------------------------- -${DB_LIB_FILE}: ${DB_LIB_OBJS} - ${AR} crus $@ $^ - -${TMP_DIR}: - ${MKDIR} ${TMP_DIR} - -${DOXYGEN_DIR}: - ${MKDIR} ${DOXYGEN_DIR} - -${TEST_RUNNER}: ${CORE_LIB_FILE} ${TEST_RUNNER_OBJS} ${DB_LIB_FILE} - ${CXX} ${LDFLAGS} -o $@ ${TEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS} - -${CORE_LIB_FILE}: - ${MAKE} -C ${CORE_DIR} - - -#------------------------------------------------------------------------------- -# Pattern rules -#------------------------------------------------------------------------------- -${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx - ${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $< - diff --git a/src/modules/db/etc/acinclude.m4 b/src/modules/db/etc/acinclude.m4 deleted file mode 100644 index 83e8ed1c0..000000000 --- a/src/modules/db/etc/acinclude.m4 +++ /dev/null @@ -1,87 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl Macro to check for available modules using pkg-conf -dnl -dnl usage: -dnl PKG_CHECK_MODULES(GSTUFF,[gtk+-2.0 >= 1.3], action-if, action-not) -dnl -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -dnl -dnl This function was taken from the glade-- project -dnl----------------------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - diff --git a/src/modules/db/etc/configure.ac b/src/modules/db/etc/configure.ac deleted file mode 100644 index 05a4753dc..000000000 --- a/src/modules/db/etc/configure.ac +++ /dev/null @@ -1,106 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(Db, 0.0, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../include/LiveSupport/Db/ConnectionManagerInterface.h) - -AC_CONFIG_HEADERS(configure.h) -AC_PROG_CXX() - -AC_CHECK_HEADERS(getopt.h) - - -dnl----------------------------------------------------------------------------- -dnl specify whether debug info should be compiled into the executable -dnl----------------------------------------------------------------------------- -AC_SUBST(CXXFLAGS) - -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [compile with debug info (no)]), - [], - [enable_debug=no]) - -if test "x${enable_debug}" = "xyes"; then - CXXFLAGS="-g -O0" - AC_DEFINE( YDEBUG, 1, [Debug is on] ) -else - CXXFLAGS="-O3" -fi - - -AC_MSG_RESULT([using compiler options: ${CXXFLAGS}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the pkg-config path -dnl----------------------------------------------------------------------------- -AC_ARG_WITH([pkg-config-path], - AC_HELP_STRING([--with-pkg-config-path], - [use the pkg-config path (prefix/lib/pkgconfig)]), - [PKG_CONFIG_PATH=${withval}], - [PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH]) - -AC_MSG_RESULT([using pkg-config path: ${PKG_CONFIG_PATH}]) - -export PKG_CONFIG_PATH - -export PATH=${prefix}/bin:${PATH} - - -PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.8.1]) -AC_SUBST(LIBXMLPP_CFLAGS) -AC_SUBST(LIBXMLPP_LIBS) - -PKG_CHECK_MODULES(LIBODBCXX,[libodbc++]) - - -dnl----------------------------------------------------------------------------- -dnl enable compilaton for code coverage data -dnl----------------------------------------------------------------------------- -AC_SUBST(COVERAGE_CXXFLAGS) - -AC_ARG_ENABLE( coverage, -[ --enable-coverage enable code coverage data generaton (no) ], - ENABLE_COVERAGE=${enableval}, ENABLE_COVERAGE="no" ) - -if test "x${ENABLE_COVERAGE}" == "xyes" ; then - COVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage" - AC_MSG_RESULT([compiling in code coverage mode]) -else - AC_MSG_RESULT([not compiling in code coverage mode]) -fi - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() diff --git a/src/modules/db/etc/connectionManagerFactory.xml b/src/modules/db/etc/connectionManagerFactory.xml deleted file mode 100644 index 9e7c74905..000000000 --- a/src/modules/db/etc/connectionManagerFactory.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - -]> - - - diff --git a/src/modules/db/etc/connectionManagerFactory.xml.template b/src/modules/db/etc/connectionManagerFactory.xml.template deleted file mode 100644 index 5c0df33ff..000000000 --- a/src/modules/db/etc/connectionManagerFactory.xml.template +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - -]> - - - diff --git a/src/modules/db/etc/doxygen.config b/src/modules/db/etc/doxygen.config deleted file mode 100644 index c8e2f7373..000000000 --- a/src/modules/db/etc/doxygen.config +++ /dev/null @@ -1,1139 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -# Doxyfile 1.3.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = Campcaster - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/doxygen - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = include src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/src/modules/db/etc/simpleConnectionManager.xml b/src/modules/db/etc/simpleConnectionManager.xml deleted file mode 100644 index aa25afaab..000000000 --- a/src/modules/db/etc/simpleConnectionManager.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -]> - diff --git a/src/modules/db/etc/simpleConnectionManager.xml.template b/src/modules/db/etc/simpleConnectionManager.xml.template deleted file mode 100644 index aaec38768..000000000 --- a/src/modules/db/etc/simpleConnectionManager.xml.template +++ /dev/null @@ -1,12 +0,0 @@ - - - - - -]> - diff --git a/src/modules/db/etc/testResultToHtml.xsl b/src/modules/db/etc/testResultToHtml.xsl deleted file mode 100644 index f9e893521..000000000 --- a/src/modules/db/etc/testResultToHtml.xsl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - Campcaster unit test results - - -

Preface

-This document is part of the -Campcaster -project, Copyright © 2004 Media -Development Loan Fund, under the GNU -GPL. -
-This is an automatically generated document. -

Scope

-This document contains the generated unit test results for the -Campcaster project. -

Summary

- - - - - - - - - - - - - - - - - - -
Total number of tests:
Tests passed:
Tests failed:
Test errors:
-
-

Tests

- - - - - - - - - - - - - -
test nametest status
failedpassed
- - -
- -
- diff --git a/src/modules/db/include/LiveSupport/Db/ConnectionManagerFactory.h b/src/modules/db/include/LiveSupport/Db/ConnectionManagerFactory.h deleted file mode 100644 index 609eb1584..000000000 --- a/src/modules/db/include/LiveSupport/Db/ConnectionManagerFactory.h +++ /dev/null @@ -1,182 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Db_ConnectionManagerFactory_h -#define LiveSupport_Db_ConnectionManagerFactory_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Db/ConnectionManagerInterface.h" - - -namespace LiveSupport { -namespace Db { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The factory to create appropriate ConnectionManager objects. - * This singleton class has to be configured with an XML element, - * describing the ConnectionManagerInterface that it should build - * and maintain. This is done by including the configuration element - * for the desired type of connection manager inside the configuration - * element for the factory. - * - * Currently only the SimpleConnectionManager is supported, thus a - * configuration file may look like this: - * - *

- *  <connectionManagerFactory>
- *      
- *  </connectionManagerFactory>
- *  
- * - * The DTD for the above XML structure is: - * - *

- *  
- *  
- * - * For the DTD and details of the simpleConnectionManager configuration - * element, see the SimpleConnectionManager documentation. - * - * @see SimpleConnectionManager - */ -class ConnectionManagerFactory : - virtual public Configurable -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The connection manager created by this factory. - */ - Ptr::Ref connectionManager; - - /** - * The default constructor. - */ - ConnectionManagerFactory(void) throw() - { - } - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~ConnectionManagerFactory(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Return a connection manager. - * - * @return the appropriate connection manager, according to the - * configuration of this factory. - */ - Ptr::Ref - getConnectionManager(void) throw () - { - return connectionManager; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Db -} // namespace LiveSupport - -#endif // LiveSupport_Db_ConnectionManagerFactory_h - diff --git a/src/modules/db/include/LiveSupport/Db/ConnectionManagerInterface.h b/src/modules/db/include/LiveSupport/Db/ConnectionManagerInterface.h deleted file mode 100644 index 65ea45bc2..000000000 --- a/src/modules/db/include/LiveSupport/Db/ConnectionManagerInterface.h +++ /dev/null @@ -1,106 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Db_ConnectionManagerInterface_h -#define LiveSupport_Db_ConnectionManagerInterface_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - - -#include "LiveSupport/Core/Ptr.h" - -namespace LiveSupport { -namespace Db { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The interface for handing out and managing database connections. - */ -class ConnectionManagerInterface -{ - public: - /** - * Get a database connection from the manager. - * After use, the connection must be returned by calling - * returnConnection(). - * - * @return a database connection to the database this manager - * serves. - * @see #returnConnection - */ - virtual Ptr::Ref - getConnection(void) throw (std::runtime_error) - = 0; - - /** - * Return a database connection previously aquired by a call to - * getConnection(), after it is not needed anymore. - * - * @param connection the connection to return. - * @see #getConnection - */ - virtual void - returnConnection(Ptr::Ref connection) - throw (std::runtime_error) - = 0; - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~ConnectionManagerInterface(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Db -} // namespace LiveSupport - -#endif // LiveSupport_Db_ConnectionManagerInterface_h - diff --git a/src/modules/db/include/LiveSupport/Db/Conversion.h b/src/modules/db/include/LiveSupport/Db/Conversion.h deleted file mode 100644 index 893a6c607..000000000 --- a/src/modules/db/include/LiveSupport/Db/Conversion.h +++ /dev/null @@ -1,117 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Db_Conversion_h -#define LiveSupport_Db_Conversion_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Db { - -using namespace boost; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A helper object holding static conversion functions, that are - * helpful when accessing databases. - */ -class Conversion -{ - private: - /** - * The default constructor. - */ - Conversion(void) throw () - { - } - - - public: - /** - * Constants to specify whether we round time values up or down. - */ - typedef enum { roundDown, - roundUp, - roundNearest } RoundingType; - - /** - * Convert a boost::ptime to a odbc::Timestamp. - * - * @param ptime the boost ptime to convert. - * @param round specify how to round the fractional part - * (default: down). - * @return an odbc::Timestamp, holding the same time. - */ - static Ptr::Ref - ptimeToTimestamp(Ptr::Ref ptime, - RoundingType round = roundDown) - throw (); - - /** - * Convert an odbc::Timestamp to a boost::ptime. - * - * @param timestamp an odbc::Timestamp to convert. - * @return a boost ptime, holding the same time. - */ - static Ptr::Ref - timestampToPtime(Ptr::Ref timestamp) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Db -} // namespace LiveSupport - -#endif // LiveSupport_Db_Conversion_h - diff --git a/src/modules/db/lib/.keepme b/src/modules/db/lib/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/db/lib/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/db/src/ConnectionManagerFactory.cxx b/src/modules/db/src/ConnectionManagerFactory.cxx deleted file mode 100644 index f7c695b00..000000000 --- a/src/modules/db/src/ConnectionManagerFactory.cxx +++ /dev/null @@ -1,105 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "SimpleConnectionManager.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string ConnectionManagerFactory::configElementNameStr = - "connectionManagerFactory"; - -/*------------------------------------------------------------------------------ - * The singleton instance of ConnectionManagerFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref ConnectionManagerFactory::singleton; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance to ConnectionManagerFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref -ConnectionManagerFactory :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new ConnectionManagerFactory()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the connection manager factory. - *----------------------------------------------------------------------------*/ -void -ConnectionManagerFactory :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - connectionManager.reset(); - - // try to look for a SimpleConnectionManager configuration element - xmlpp::Node::NodeList nodes = element.get_children( - SimpleConnectionManager::getConfigElementName()); - if (nodes.size() >= 1) { - const xmlpp::Element * configElement = - dynamic_cast (*(nodes.begin())); - Ptr::Ref scm(new SimpleConnectionManager()); - scm->configure(*configElement); - connectionManager = scm; - } - - if (!connectionManager) { - throw std::invalid_argument("no storage client factories to configure"); - } -} - - diff --git a/src/modules/db/src/ConnectionManagerFactoryTest.cxx b/src/modules/db/src/ConnectionManagerFactoryTest.cxx deleted file mode 100644 index 3dc2fd854..000000000 --- a/src/modules/db/src/ConnectionManagerFactoryTest.cxx +++ /dev/null @@ -1,122 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "ConnectionManagerFactoryTest.h" - - -using namespace odbc; -using namespace LiveSupport::Db; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(ConnectionManagerFactoryTest); - -/** - * The name of the configuration file for the connection manager factory. - */ -static const std::string configFileName = "connectionManagerFactory.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -ConnectionManagerFactoryTest :: setUp(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -ConnectionManagerFactoryTest :: tearDown(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Test to see if the singleton Hello object is accessible - *----------------------------------------------------------------------------*/ -void -ConnectionManagerFactoryTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - configFileName); - const xmlpp::Element * root = document->get_root_node(); - Ptr::Ref cmf = - ConnectionManagerFactory::getInstance(); - - cmf->configure(*root); - - Ptr::Ref cm = cmf->getConnectionManager(); - CPPUNIT_ASSERT(cm); - - Ptr::Ref connection = cm->getConnection(); - CPPUNIT_ASSERT(connection); - - // so far, so good. now simply execute "SELECT 1", and see if - // it works - Ptr::Ref stmt(connection->createStatement()); - Ptr::Ref rs(stmt->executeQuery("SELECT 1")); - CPPUNIT_ASSERT(rs->next()); - CPPUNIT_ASSERT(rs->getInt(1) == 1); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } catch (std::runtime_error &e) { - CPPUNIT_FAIL(e.what()); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL(e.what()); - } -} - diff --git a/src/modules/db/src/ConnectionManagerFactoryTest.h b/src/modules/db/src/ConnectionManagerFactoryTest.h deleted file mode 100644 index a7382bfc8..000000000 --- a/src/modules/db/src/ConnectionManagerFactoryTest.h +++ /dev/null @@ -1,103 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ConnectionManagerFactoryTest_h -#define ConnectionManagerFactoryTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/BaseTestMethod.h" - - -namespace LiveSupport { -namespace Db { - -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the ConnectionManagerFactory class. - * - * @see ConnectionManagerFactory - */ -class ConnectionManagerFactoryTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(ConnectionManagerFactoryTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Db -} // namespace LiveSupport - -#endif // ConnectionManagerFactoryTest_h - diff --git a/src/modules/db/src/Conversion.cxx b/src/modules/db/src/Conversion.cxx deleted file mode 100644 index d0012471e..000000000 --- a/src/modules/db/src/Conversion.cxx +++ /dev/null @@ -1,92 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Db/Conversion.h" - - -using namespace boost; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Convert a boost::ptime to an odbc::Timestamp - *----------------------------------------------------------------------------*/ -Ptr::Ref -Conversion :: ptimeToTimestamp(Ptr::Ref ptime, - RoundingType round) - throw () -{ - posix_time::ptime newPtime = *ptime; - if (round == roundUp && newPtime.time_of_day().fractional_seconds() != 0) { - newPtime += posix_time::seconds(1); - } else if (round == roundNearest) { - newPtime += posix_time::microseconds(500000); - } - - gregorian::date date = newPtime.date(); - posix_time::time_duration time = newPtime.time_of_day(); - - Ptr::Ref timestamp(new odbc::Timestamp(date.year(), - date.month(), - date.day(), - time.hours(), - time.minutes(), - time.seconds())); - return timestamp; -} - - -/*------------------------------------------------------------------------------ - * Convert an odbc::Timestamp to a boost::ptime - *----------------------------------------------------------------------------*/ -Ptr::Ref -Conversion :: timestampToPtime(Ptr::Ref timestamp) - throw() -{ - // don't convert through the time_t format, as probably because of - // timezone settings, boost::posix_time::from_time_t() ruins the - // actual value - std::string timeStr = timestamp->toString(); - Ptr::Ref ptime(new posix_time::ptime( - posix_time::time_from_string(timeStr))); - return ptime; -} - diff --git a/src/modules/db/src/SimpleConnectionManager.cxx b/src/modules/db/src/SimpleConnectionManager.cxx deleted file mode 100644 index 81254d578..000000000 --- a/src/modules/db/src/SimpleConnectionManager.cxx +++ /dev/null @@ -1,146 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "SimpleConnectionManager.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string SimpleConnectionManager::configElementNameStr = - "simpleConnectionManager"; - -/** - * The name of the attribute to get the dsn for the connection. - */ -static const std::string dsnAttrName = "dsn"; - -/** - * The name of the attribute to get the userName for the connection. - */ -static const std::string userNameAttrName = "userName"; - -/** - * The name of the attribute to get the password for the connection. - */ -static const std::string passwordAttrName = "password"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the connection manager factory. - *----------------------------------------------------------------------------*/ -void -SimpleConnectionManager :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - const xmlpp::Attribute * attribute = 0; - - if (!(attribute = element.get_attribute(dsnAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += dsnAttrName; - throw std::invalid_argument(eMsg); - } - dsn = attribute->get_value(); - - if (!(attribute = element.get_attribute(userNameAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += userNameAttrName; - throw std::invalid_argument(eMsg); - } - userName = attribute->get_value(); - - if (!(attribute = element.get_attribute(passwordAttrName))) { - std::string eMsg = "Missing attribute "; - eMsg += passwordAttrName; - throw std::invalid_argument(eMsg); - } - password = attribute->get_value(); -} - - -/*------------------------------------------------------------------------------ - * Give out a connection. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SimpleConnectionManager :: getConnection(void) - throw (std::runtime_error) -{ - odbc::Connection * conn; - try { - conn = odbc::DriverManager::getConnection(dsn, userName, password); - } catch (std::exception &e) { - throw std::runtime_error(e.what()); - } - - if (!conn) { - std::string eMsg = "unable to open ODBC connection for DSN "; - eMsg += dsn; - throw std::runtime_error(eMsg); - } - - Ptr::Ref connection(conn); - return connection; -} - - -/*------------------------------------------------------------------------------ - * Receive a connection back. - *----------------------------------------------------------------------------*/ -void -SimpleConnectionManager :: returnConnection( - Ptr::Ref connection) - throw (std::runtime_error) -{ - // nothing to do here... - // we could save the outgoing connections to a set in getConnection() - // and check here to see if the returned one is contained there -} - diff --git a/src/modules/db/src/SimpleConnectionManager.h b/src/modules/db/src/SimpleConnectionManager.h deleted file mode 100644 index 8aa98f942..000000000 --- a/src/modules/db/src/SimpleConnectionManager.h +++ /dev/null @@ -1,184 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SimpleConnectionManager_h -#define SimpleConnectionManager_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include -#include - - -namespace LiveSupport { -namespace Db { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A simple connection manager, basically a facade to the underlying - * odbc::DriverManager class. - * This class can be configured with the following XML element, containing - * the ODBC Data Source Name (DSN), ODBC user name and ODBC password - * the manager will connect with to the ODBC source. The XML element looks - * as follows: - * - *

- *  
- *  
- * - * The DTD for the above XML structure is: - * - *

- *  
- *  
- *  
- *  
- *  
- */ -class SimpleConnectionManager : - virtual public Configurable, - virtual public ConnectionManagerInterface -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The ODBC Data Source Name this manager connects to. - */ - std::string dsn; - - /** - * The user name to use when connecting to the ODBC DSN. - */ - std::string userName; - - /** - * The password to use when connecting to the ODBC DSN. - */ - std::string password; - - - public: - /** - * The default constructor. - */ - SimpleConnectionManager(void) throw () - { - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~SimpleConnectionManager(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Get a database connection from the manager. - * After use, the connection must be returned by calling - * returnConnection(). - * - * @return a database connection to the database this manager - * serves. - * @see #returnConnection - */ - virtual Ptr::Ref - getConnection(void) throw (std::runtime_error); - - /** - * Return a database connection previously aquired by a call to - * getConnection(), after it is not needed anymore. - * - * @param connection the connection to return. - * @see #getConnection - */ - virtual void - returnConnection(Ptr::Ref connection) - throw (std::runtime_error); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Db -} // namespace LiveSupport - -#endif // SimpleConnectionManager_h - diff --git a/src/modules/db/src/SimpleConnectionManagerTest.cxx b/src/modules/db/src/SimpleConnectionManagerTest.cxx deleted file mode 100644 index 232afe44d..000000000 --- a/src/modules/db/src/SimpleConnectionManagerTest.cxx +++ /dev/null @@ -1,206 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include -#include - -#include "SimpleConnectionManager.h" -#include "SimpleConnectionManagerTest.h" - - -using namespace odbc; -using namespace LiveSupport::Db; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(SimpleConnectionManagerTest); - -/** - * The name of the configuration file for the connection manager. - */ -static const std::string configFileName = "simpleConnectionManager.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -SimpleConnectionManagerTest :: setUp(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -SimpleConnectionManagerTest :: tearDown(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Test to see if the singleton Hello object is accessible - *----------------------------------------------------------------------------*/ -void -SimpleConnectionManagerTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - configFileName); - const xmlpp::Element * root = document->get_root_node(); - Ptr::Ref scm(new SimpleConnectionManager()); - - scm->configure(*root); - - Ptr::Ref connection = scm->getConnection(); - CPPUNIT_ASSERT(connection); - - // so far, so good. now simply execute "SELECT 1", and see if - // it works - Ptr::Ref stmt(connection->createStatement()); - Ptr::Ref rs(stmt->executeQuery("SELECT 1")); - CPPUNIT_ASSERT(rs->next()); - CPPUNIT_ASSERT(rs->getInt(1) == 1); - - rs.reset(); - stmt->close(); - stmt.reset(); - scm->returnConnection(connection); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } catch (std::runtime_error &e) { - CPPUNIT_FAIL(e.what()); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Test to handle large integers. - *----------------------------------------------------------------------------*/ -void -SimpleConnectionManagerTest :: bigIntTest(void) - throw (CPPUNIT_NS::Exception) -{ - long long testValue = 0x7fffffffffffffffLL; - std::string createStmt = "CREATE TABLE testTable\n" - "(\n" - " id BIGINT NOT NULL\n" - ");"; - bool b; - - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - configFileName); - const xmlpp::Element * root = document->get_root_node(); - Ptr::Ref scm(new SimpleConnectionManager()); - - scm->configure(*root); - - Ptr::Ref connection = scm->getConnection(); - CPPUNIT_ASSERT(connection); - - // simply see if selecting the highest 63 bit number works... - Ptr::Ref pstmt(connection->prepareStatement( - "SELECT ?")); - pstmt->setLong(1, testValue); - Ptr::Ref rs(pstmt->executeQuery()); - CPPUNIT_ASSERT(rs->next()); - CPPUNIT_ASSERT(rs->getLong(1) == testValue); - rs.reset(); - pstmt->close(); - pstmt.reset(); - - // so far, so good. now create a table with a BIGINT column - // and try the same - Ptr::Ref stmt(connection->createStatement()); - stmt->execute(createStmt); - stmt->close(); - stmt.reset(); - - pstmt.reset(connection->prepareStatement("INSERT INTO testTable " - " VALUES(?)")); - pstmt->setLong(1, testValue); - CPPUNIT_ASSERT(pstmt->executeUpdate() == 1); - pstmt->close(); - pstmt.reset(); - - stmt.reset(connection->createStatement()); - rs.reset(stmt->executeQuery("SELECT * FROM testTable")); - CPPUNIT_ASSERT(rs->next()); -//std::cerr << std::endl; -//std::cerr << "rs->getLong: " << rs->getLong(1) << std::endl; -//std::cerr << "testValue: " << testValue << std::endl; - b = rs->getLong(1) == testValue; - CPPUNIT_ASSERT(b); - rs.reset(); - stmt->close(); - stmt.reset(); - - stmt.reset(connection->createStatement()); - stmt->executeUpdate("DROP TABLE testTable"); - stmt->close(); - stmt.reset(); - - scm->returnConnection(connection); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } catch (std::runtime_error &e) { - CPPUNIT_FAIL(e.what()); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL(e.what()); - } catch (SQLException &e) { - CPPUNIT_FAIL(e.what()); - } -} - diff --git a/src/modules/db/src/SimpleConnectionManagerTest.h b/src/modules/db/src/SimpleConnectionManagerTest.h deleted file mode 100644 index 8feebcc5e..000000000 --- a/src/modules/db/src/SimpleConnectionManagerTest.h +++ /dev/null @@ -1,112 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SimpleConnectionManagerTest_h -#define SimpleConnectionManagerTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/BaseTestMethod.h" - - -namespace LiveSupport { -namespace Db { - -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the SimpleConnectionManager class. - * - * @see SimpleConnectionManager - */ -class SimpleConnectionManagerTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(SimpleConnectionManagerTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(bigIntTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to handle large integers. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - bigIntTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Db -} // namespace LiveSupport - -#endif // SimpleConnectionManagerTest_h - diff --git a/src/modules/db/src/TestRunner.cxx b/src/modules/db/src/TestRunner.cxx deleted file mode 100644 index 8ce1c29bb..000000000 --- a/src/modules/db/src/TestRunner.cxx +++ /dev/null @@ -1,275 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -using namespace LiveSupport::Core; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * Our copyright notice, should be at most 80 columns - */ -static const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -static const char options[] = "ho:s:v"; - -/** - * Structure describing the long options - */ -static const struct option longOptions[] = { - { "help", no_argument, 0, 'h' }, - { "output", required_argument, 0, 'o' }, - { "stylesheet", required_argument, 0, 's' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; - -/** - * The encoding to use for the output file. - */ -static const std::string encoding = "utf-8"; - -/** - * The output XML file name. - */ -static Ptr::Ref xmlOutFileName; - -/** - * The XSLT attached to the output file. - */ -static Ptr::Ref xsltFileName; - - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -static void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -static void -printUsage ( const char invocation[], - std::ostream & os ); - -/** - * Process command line arguments. - * - * @param argc the number of arguments. - * @param argv the arguments themselves. - * @return true of all went well, false in case the program should exit - * after this call. - */ -static bool -processArguments(int argc, char *argv[]); - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Run all tests - *----------------------------------------------------------------------------*/ -int -main( int argc, - char * argv[] ) throw () -{ - if (!processArguments(argc, argv)) { - return 0; - } - - // Create the event manager and test controller - CPPUNIT_NS::TestResult controller; - - // Add a listener that colllects test result - CPPUNIT_NS::TestResultCollector result; - controller.addListener( &result ); - - // Add a listener that print dots as test run. - CPPUNIT_NS::BriefTestProgressListener progress; - controller.addListener( &progress ); - - // Add the top suite to the test runner - CPPUNIT_NS::TestRunner runner; - runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); - runner.run( controller ); - - // Print test in a compiler compatible format. - CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr ); - outputter.setLocationFormat("%p:%l:"); - outputter.write(); - - // also generate an XML document as an output - std::ofstream xmlOutFile(xmlOutFileName->c_str()); - CPPUNIT_NS::XmlOutputter xmlOutputter(&result, xmlOutFile, encoding); - xmlOutputter.setStandalone(false); - if (xsltFileName) { - xmlOutputter.setStyleSheet(*xsltFileName); - } - xmlOutputter.write(); - xmlOutFile.flush(); - xmlOutFile.close(); - - return result.wasSuccessful() ? 0 : 1; -} - - -/*------------------------------------------------------------------------------ - * Process command line arguments. - *----------------------------------------------------------------------------*/ -static bool -processArguments(int argc, char *argv[]) -{ - int i; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'h': - printUsage(argv[0], std::cout); - return false; - - case 'o': - xmlOutFileName.reset(new std::string(optarg)); - break; - - case 's': - xsltFileName.reset(new std::string(optarg)); - break; - - case 'v': - printVersion(std::cout); - return false; - - default: - printUsage(argv[0], std::cout); - return false; - } - } - - if (optind < argc) { - std::cerr << "error processing command line arguments" << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - if (!xmlOutFileName) { - std::cerr << "mandatory option output file name not specified" - << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - std::cerr << "writing output to '" << *xmlOutFileName << '\'' << std::endl; - if (xsltFileName) { - std::cerr << "using XSLT file '" << *xsltFileName << '\'' << std::endl; - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -static void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -static void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION]" - << std::endl - << " mandatory options:" << std::endl - << " -o, --output=file.name write test results into this XML file" - << std::endl - << " optional options:" << std::endl - << " -s, --stylesheet specify this XSLT for the output file" - << std::endl - << " this is either an absolute URI, or a" - << std::endl - << " relative path for the output document" - << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/modules/db/tmp/.keepme b/src/modules/db/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/db/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/widgets/bin/autogen.sh b/src/modules/widgets/bin/autogen.sh deleted file mode 100755 index 20187cd2c..000000000 --- a/src/modules/widgets/bin/autogen.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="Widgets" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -echo " aclocal $ACLOCAL_FLAGS" -cp -f ${configure_ac} ${tmpdir} -cp -f ${etcdir}/acinclude.m4 ${tmpdir} -aclocal $ACLOCAL_FLAGS - -echo " autoheader ${configure_ac}" -autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/modules/widgets/configure b/src/modules/widgets/configure deleted file mode 100755 index 26ccda218..000000000 --- a/src/modules/widgets/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen $*) -fi - -(cd $tmpdir && $configure $*) - diff --git a/src/modules/widgets/doc/.keepme b/src/modules/widgets/doc/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/widgets/doc/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/widgets/etc/Makefile.in b/src/modules/widgets/etc/Makefile.in deleted file mode 100644 index af6f4dfa5..000000000 --- a/src/modules/widgets/etc/Makefile.in +++ /dev/null @@ -1,225 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# @configure_input@ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -CP = cp -f - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -PACKAGE_NAME = @PACKAGE_NAME@ - -BASE_DIR = @builddir@ -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -ETC_DIR = ${BASE_DIR}/etc -INCLUDE_DIR = ${BASE_DIR}/include -LIB_DIR = ${BASE_DIR}/lib -SRC_DIR = ${BASE_DIR}/src -TMP_DIR = ${BASE_DIR}/tmp -VAR_DIR = ${BASE_DIR}/var - -prefix = @prefix@ - -USR_DIR = ${prefix} -USR_INCLUDE_DIR = ${USR_DIR}/include -USR_BIN_DIR = ${USR_DIR}/bin -USR_LIB_DIR = ${USR_DIR}/lib -USR_VAR_DIR = ${USR_DIR}/var - -MODULES_DIR = ${BASE_DIR}/.. - -CORE_DIR = ${MODULES_DIR}/core -CORE_INCLUDE_DIR = ${CORE_DIR}/include -CORE_LIB_DIR = ${CORE_DIR}/lib -CORE_LIB = livesupport_core -CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a - -GENRB = @GENRB@ -TMP_LOCALIZATION_DIR = ${TMP_DIR}/localization -GENRBOPTS = --destdir ${TMP_LOCALIZATION_DIR} \ - --encoding utf-8 \ - --strict - -VPATH = ${SRC_DIR} - -BOOST_CFLAGS=@BOOST_CPPFLAGS@ -BOOST_LIBS=@BOOST_LDFLAGS@ -BOOST_DATE_TIME_LIB=@BOOST_DATE_TIME_LIB@ - -LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ -LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ - -ICU_CFLAGS=@ICU_CFLAGS@ -ICU_CXXFLAGS=@ICU_CXXFLAGS@ -ICU_LIBS=@ICU_LIBS@ - -GTKMM_CFLAGS=@GTKMM_CFLAGS@ -GTKMM_LIBS=@GTKMM_LIBS@ - -LIBGLADEMM_CFLAGS=@LIBGLADEMM_CFLAGS@ -LIBGLADEMM_LIBS=@LIBGLADEMM_LIBS@ - -TEST_RESULTS = ${DOC_DIR}/testResults.xml -# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR -TEST_XSLT = ../etc/testResultToHtml.xsl - -WIDGETS_LIB = livesupport_widgets -WIDGETS_LIB_FILE = ${LIB_DIR}/lib${WIDGETS_LIB}.a -TEST_EXE = ${TMP_DIR}/test -TEST_CFG = ${ETC_DIR}/widgetFactory.xml - -DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config - -export LD_LIBRARY_PATH:=${USR_LIB_DIR}:${LD_LIBRARY_PATH} - - -#------------------------------------------------------------------------------- -# Configuration parameters -#------------------------------------------------------------------------------- -CPPFLAGS = @CPPFLAGS@ -CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ - -pedantic -Wall -Wno-long-long \ - ${BOOST_CFLAGS} \ - ${LIBXMLPP_CFLAGS} \ - ${ICU_CFLAGS} \ - ${GTKMM_CFLAGS} \ - ${LIBGLADEMM_CFLAGS} \ - -I${USR_INCLUDE_DIR} \ - -I${CORE_INCLUDE_DIR} \ - -I${INCLUDE_DIR} -I${TMP_DIR} -LDFLAGS = @LDFLAGS@ -pthread \ - ${BOOST_LIBS} \ - ${LIBXMLPP_LIBS} \ - ${ICU_LIBS} \ - ${GTKMM_LIBS} \ - ${LIBGLADEMM_LIBS} \ - -L${USR_LIB_DIR} \ - -L${CORE_LIB_DIR} \ - -L${LIB_DIR} - - -#------------------------------------------------------------------------------- -# Dependencies -#------------------------------------------------------------------------------- -WIDGETS_LIB_OBJS = ${TMP_DIR}/ComboBoxText.o \ - ${TMP_DIR}/MetadataComboBoxText.o \ - ${TMP_DIR}/OperatorComboBoxText.o \ - ${TMP_DIR}/WidgetFactory.o \ - ${TMP_DIR}/Colors.o \ - ${TMP_DIR}/ZebraTreeView.o \ - ${TMP_DIR}/ZebraCellRenderer.o - -TEST_EXE_OBJS = ${TMP_DIR}/TestWindow.o \ - ${TMP_DIR}/main.o - -TEST_RUNNER_RES = ${TMP_LOCALIZATION_DIR}/root.res \ - ${TMP_LOCALIZATION_DIR}/en.res \ - ${TMP_LOCALIZATION_DIR}/hu.res - -TEST_EXE_LIBS = -l${WIDGETS_LIB} -l${CORE_LIB} ${ICU_LIBS} \ - ${BOOST_DATE_TIME_LIB} -lxmlrpc++ -lssl - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -.PHONY: all dir_setup doc clean docclean depclean distclean check install - -all: dir_setup ${WIDGETS_LIB_FILE} - -dir_setup: ${TMP_DIR} ${TMP_LOCALIZATION_DIR} ${DOXYGEN_DIR} - -doc: - ${DOXYGEN} ${DOXYGEN_CONFIG} - -clean: - ${RM} ${WIDGETS_LIB_OBJS} ${WIDGETS_LIB_FILE} - ${RM} ${TEST_EXE_OBJS} ${TEST_EXE} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info - ${RMDIR} ${TMP_LOCALIZATION_DIR} - -docclean: - ${RMDIR} ${DOXYGEN_DIR}/html - ${RMDIR} ${COVERAGE_DIR}/* - ${RM} ${TEST_RESULTS} - -depclean: clean - -distclean: clean docclean - ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te* ${TMP_DIR}/ac*.m4 - -run: all ${TEST_EXE} ${TEST_RUNNER_RES} - ${TEST_EXE} -c ${TEST_CFG} - -check: all - -install: all - ${MKDIR} ${USR_INCLUDE_DIR}/LiveSupport/Widgets - ${CP} ${INCLUDE_DIR}/LiveSupport/Widgets/*.h \ - ${USR_INCLUDE_DIR}/LiveSupport/Widgets - ${CP} ${WIDGETS_LIB_FILE} ${USR_LIB_DIR} - ${MKDIR} ${USR_VAR_DIR}/Campcaster/Widgets/icons - ${CP} ${VAR_DIR}/icons/*.png \ - ${USR_VAR_DIR}/Campcaster/Widgets/icons - - -#------------------------------------------------------------------------------- -# Specific targets -#------------------------------------------------------------------------------- -${WIDGETS_LIB_FILE}: ${WIDGETS_LIB_OBJS} - ${AR} crus $@ $^ - -${TMP_DIR}: - ${MKDIR} ${TMP_DIR} - -${TMP_LOCALIZATION_DIR}: - ${MKDIR} ${TMP_LOCALIZATION_DIR} - -${DOXYGEN_DIR}: - ${MKDIR} ${DOXYGEN_DIR} - -${TEST_EXE}: ${CORE_LIB_FILE} ${TEST_EXE_OBJS} ${WIDGETS_LIB_FILE} - ${CXX} ${LDFLAGS} -o $@ ${TEST_EXE_OBJS} ${TEST_EXE_LIBS} \ - ${WIDGETS_LIB_FILE} - -${CORE_LIB_FILE}: - ${MAKE} -C ${CORE_DIR} - - -#------------------------------------------------------------------------------- -# Pattern rules -#------------------------------------------------------------------------------- -${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx - ${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $< - -${TMP_LOCALIZATION_DIR}/%.res : ${VAR_DIR}/%.txt - ${GENRB} ${GENRBOPTS} $^ - diff --git a/src/modules/widgets/etc/acinclude.m4 b/src/modules/widgets/etc/acinclude.m4 deleted file mode 100644 index 0c67c1126..000000000 --- a/src/modules/widgets/etc/acinclude.m4 +++ /dev/null @@ -1,463 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl Macro to check for available modules using pkg-conf -dnl -dnl usage: -dnl PKG_CHECK_MODULES(GSTUFF,[gtk+-2.0 >= 1.3], action-if, action-not) -dnl -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -dnl -dnl This function was taken from the glade-- project -dnl----------------------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for C++ namespaces -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ac_cxx_namespaces.html -dnl -dnl usage: -dnl If the compiler can prevent names clashes using namespaces, -dnl define HAVE_NAMESPACES. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CXX_NAMESPACES], -[AC_CACHE_CHECK(whether the compiler implements namespaces, -ac_cv_cxx_namespaces, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) -fi -]) - - -dnl----------------------------------------------------------------------------- -dnl Test for the Boost C++ libraries of a particular version (or newer). -dnl for more information on boost, see http://www.boost.org/ -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ax_boost_base.html -dnl -dnl usage: -dnl If no path to the installed boost library is given the macro searches -dnl under ${prefix}, /usr, /usr/local, and /opt, and evaluates the $BOOST_ROOT -dnl environment variable. Further documentation is available at -dnl http://randspringer.de/boost/index.html -dnl -dnl This macro calls: AC_SUBST(BOOST_CPPFLAGS) and AC_SUBST(BOOST_LDFLAGS) -dnl and sets: HAVE_BOOST -dnl -dnl Modified for Campcaster: -dnl * --with-boost default changed to Yes; -dnl * if the library is not found, it does not die, just prints "no", leaves -dnl HAVE_BOOST undefined, and sets the BOOST_CPPFLAGS and BOOST_LDFLAGS -dnl variables to ""; -dnl * ${prefix} is prepended to the search path. -dnl -dnl Author: Thomas Porschberg -dnl -dnl License: -dnl Copyright © 2006 Thomas Porschberg -dnl Copying and distribution of this file, with or without modification, -dnl are permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is Yes) - it is possible to specify the root directory for boost (optional)]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - BOOST_CPPFLAGS="-I$ac_boost_path/include" - else - for ac_boost_path_tmp in ${prefix} /usr /usr/local /opt ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - for ac_boost_path in /usr /usr/local /opt ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - BOOST_LDFLAGS="-L$best_path/lib" - - if test "x$BOOST_ROOT" != "x"; then - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - BOOST_CPPFLAGS="" - BOOST_LDFLAGS="" - AC_MSG_RESULT(no) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) - - -dnl----------------------------------------------------------------------------- -dnl Test for Date_Time library from the Boost C++ libraries. -dnl for more information on boost, see http://www.boost.org/ -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ax_boost_date_time.html -dnl -dnl usage: -dnl The macro requires a preceding call to AX_BOOST_BASE. -dnl Further documentation is available at -dnl . -dnl -dnl This macro calls: AC_SUBST(BOOST_DATE_TIME_LIB) -dnl and sets: HAVE_BOOST_DATE_TIME -dnl -dnl Modified for Campcaster: -dnl * --with-boost-date-time default changed to Yes. -dnl * added some more recognized suffixes to the library's name, incl. "-st". -dnl -dnl Authors: -dnl Thomas Porschberg -dnl Michael Tindal -dnl -dnl License: -dnl Copyright © 2006 Thomas Porschberg -dnl Copying and distribution of this file, with or without modification, -dnl are permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AX_BOOST_DATE_TIME], -[ - AC_ARG_WITH([boost-date-time], - AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@], - [use the Date_Time library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_date_time_lib="" - else - want_boost="yes" - ax_boost_user_date_time_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Date_Time library is available, - ax_cv_boost_date_time, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::gregorian; date d(2002,Jan,10); - return 0; - ]]), - ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_date_time" = "xyes"; then - AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) - BN=boost_date_time - if test "x$ax_boost_user_date_time_lib" = "x"; then - for ax_lib in $BN $BN-st $BN-mt $BN-mt-s $BN-s \ - $BN-$CC $BN-$CC-st $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-st lib$BN-mt lib$BN-mt-s lib$BN-s \ - lib$BN-$CC lib$BN-$CC-st lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-st $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], - [link_date_time="no"]) - done - else - for ax_lib in $ax_boost_user_date_time_lib $BN-$ax_boost_user_date_time_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], - [link_date_time="no"]) - done - - fi - if test "x$link_date_time" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for ICU of sufficient version by looking at icu-config -dnl -dnl usage: -dnl AC_CHECK_ICU(version, action-if, action-not) -dnl -dnl defines ICU_LIBS, ICU_CFLAGS, ICU_CXXFLAGS, see icu-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_ICU], [ - succeeded=no - - if test -z "$ICU_CONFIG"; then - AC_PATH_PROG(ICU_CONFIG, icu-config, no) - fi - - if test "$ICU_CONFIG" = "no" ; then - echo "*** The icu-config script could not be found. Make sure it is" - echo "*** in your path, and that taglib is properly installed." - echo "*** Or see http://ibm.com/software/globalization/icu/" - else - ICU_VERSION=`$ICU_CONFIG --version` - AC_MSG_CHECKING(for ICU >= $1) - VERSION_CHECK=`expr $ICU_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(ICU_CFLAGS) - ICU_CFLAGS=`$ICU_CONFIG --cflags` - AC_MSG_RESULT($ICU_CFLAGS) - - AC_MSG_CHECKING(ICU_CXXFLAGS) - ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags` - AC_MSG_RESULT($ICU_CXXFLAGS) - - AC_MSG_CHECKING(ICU_LIBS) - ICU_LIBS=`$ICU_CONFIG --ldflags` - AC_MSG_RESULT($ICU_LIBS) - else - ICU_CFLAGS="" - ICU_CXXFLAGS="" - ICU_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find ICU >= $1",) - fi - - AC_SUBST(ICU_CFLAGS) - AC_SUBST(ICU_CXXFLAGS) - AC_SUBST(ICU_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3]) - fi -]) - diff --git a/src/modules/widgets/etc/configure.ac b/src/modules/widgets/etc/configure.ac deleted file mode 100644 index c1aff0e22..000000000 --- a/src/modules/widgets/etc/configure.ac +++ /dev/null @@ -1,130 +0,0 @@ -bdnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(Widgets, 0.0, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../src/ComboBoxText.cxx) - -AC_CONFIG_HEADERS(configure.h) -AC_PROG_CXX() - -AC_CHECK_HEADERS(getopt.h) - - -dnl----------------------------------------------------------------------------- -dnl specify whether debug info should be compiled into the executable -dnl----------------------------------------------------------------------------- -AC_SUBST(CXXFLAGS) - -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [compile with debug info (no)]), - [], - [enable_debug=no]) - -if test "x${enable_debug}" = "xyes"; then - CXXFLAGS="-g -O0" - AC_DEFINE( YDEBUG, 1, [Debug is on] ) -else - CXXFLAGS="-O3" -fi - - -AC_MSG_RESULT([using compiler options: ${CXXFLAGS}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the pkg-config path -dnl----------------------------------------------------------------------------- -AC_ARG_WITH([pkg-config-path], - AC_HELP_STRING([--with-pkg-config-path], - [use the pkg-config path (prefix/lib/pkgconfig)]), - [PKG_CONFIG_PATH=${withval}], - [PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH]) - -AC_MSG_RESULT([using pkg-config path: ${PKG_CONFIG_PATH}]) - -export PKG_CONFIG_PATH - -export PATH=${prefix}/bin:${PATH} - - -AX_BOOST_BASE([1.33.1]) -if test "x${BOOST_CPPFLAGS}" != "x"; then - AX_BOOST_DATE_TIME - if test "x${BOOST_DATE_TIME_LIB}" = "x"; then - AC_MSG_ERROR([Boost date-time library not found]) - fi -else - AC_MSG_ERROR([Boost library >= 1.33.1 not found]) -fi - -AC_CHECK_ICU(3.0) -AC_SUBST(ICU_CFLAGS) -AC_SUBST(ICU_CXXFLAGS) -AC_SUBST(ICU_LIBS) - -AC_PATH_PROG(GENRB, genrb) -AC_SUBST(GENRB) - -PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.8.1]) -AC_SUBST(LIBXMLPP_CFLAGS) -AC_SUBST(LIBXMLPP_LIBS) - -PKG_CHECK_MODULES(GTKMM,[gtkmm-2.4 >= 2.5.5]) -AC_SUBST(GTKMM_CFLAGS) -AC_SUBST(GTKMM_LIBS) - -PKG_CHECK_MODULES(LIBGLADEMM,[libglademm-2.4 >= 2.6.2]) -AC_SUBST(LIBGLADEMM_CFLAGS) -AC_SUBST(LIBGLADEMM_LIBS) - - -dnl----------------------------------------------------------------------------- -dnl enable compilaton for code coverage data -dnl----------------------------------------------------------------------------- -AC_SUBST(COVERAGE_CXXFLAGS) - -AC_ARG_ENABLE( coverage, -[ --enable-coverage enable code coverage data generaton (no) ], - ENABLE_COVERAGE=${enableval}, ENABLE_COVERAGE="no" ) - -if test "x${ENABLE_COVERAGE}" == "xyes" ; then - COVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage" - AC_MSG_RESULT([compiling in code coverage mode]) -else - AC_MSG_RESULT([not compiling in code coverage mode]) -fi - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() diff --git a/src/modules/widgets/etc/doxygen.config b/src/modules/widgets/etc/doxygen.config deleted file mode 100644 index c8e2f7373..000000000 --- a/src/modules/widgets/etc/doxygen.config +++ /dev/null @@ -1,1139 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -# Doxyfile 1.3.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = Campcaster - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/doxygen - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = include src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = include - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/src/modules/widgets/etc/resourceBundle.xml b/src/modules/widgets/etc/resourceBundle.xml deleted file mode 100644 index 56cf817d4..000000000 --- a/src/modules/widgets/etc/resourceBundle.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - -]> - diff --git a/src/modules/widgets/etc/widgetFactory.xml b/src/modules/widgets/etc/widgetFactory.xml deleted file mode 100644 index f8bdc64c3..000000000 --- a/src/modules/widgets/etc/widgetFactory.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - -]> - - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/Colors.h b/src/modules/widgets/include/LiveSupport/Widgets/Colors.h deleted file mode 100644 index 238a34141..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/Colors.h +++ /dev/null @@ -1,111 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_Colors_h -#define LiveSupport_Widgets_Colors_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "gdkmm/color.h" -#include "gdkmm/colormap.h" - - -namespace LiveSupport { -namespace Widgets { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A helper class to hold all the standard colors used by the LiveSupport GUI. - * - * The definitions of the colors can be found in doc/gui/styleguide.pdf; - * the last two colors were taken from doc/gui/designs/livemode.gif. - */ -class Colors -{ - public: - /** - * The names of the colors. - */ - typedef enum { White, Black, - LightBlue, BrightBlue, Blue, DarkBlue, - Gray, SlateGray, MediumBlueGray, DarkGray, - Yellow, Orange, Red, - MasterPanelCenterBlue, LiveModeRowBlue, - WindowBackground = White } ColorName; - - private: - /** - * The vector holding the colors. - */ - static std::map colors; - - /** - * This loads the colors. - */ - static void - initialize(void) throw (); - - /** - * Whether we have been initialized yet. - */ - bool - static initialized; - - public: - /** - * Get a color by its name. - */ - static const Gdk::Color& - getColor(const ColorName&) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_Colors_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/ComboBoxText.h b/src/modules/widgets/include/LiveSupport/Widgets/ComboBoxText.h deleted file mode 100644 index 7719369fb..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/ComboBoxText.h +++ /dev/null @@ -1,88 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_ComboBoxText_h -#define LiveSupport_Widgets_ComboBoxText_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -namespace LiveSupport { -namespace Widgets { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A combo box holding text entries. - * This just adds another constructor to its parent class, so that it can - * be used with Libglade. - */ -class ComboBoxText : public Gtk::ComboBoxText -{ - public: - - /** - * Constructor to be used with Glade::Xml::get_widget_derived(). - * - * @param baseClass widget of the parent class, created by Glade. - * @param glade the Glade object. - */ - ComboBoxText(GtkComboBox * baseClass, - const Glib::RefPtr & glade) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~ComboBoxText(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_ComboBoxText_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/CornerBitmaps.h b/src/modules/widgets/include/LiveSupport/Widgets/CornerBitmaps.h deleted file mode 100644 index 4e8a0a730..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/CornerBitmaps.h +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_CornerBitmaps_h -#define LiveSupport_Widgets_CornerBitmaps_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "gdkmm/bitmap.h" - - -namespace LiveSupport { -namespace Widgets { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A helper class to hold a set of corner bitmaps. - */ -class CornerBitmaps -{ - public: - /** - * The top left image. - */ - Glib::RefPtr topLeftBitmap; - - /** - * The top right image. - */ - Glib::RefPtr topRightBitmap; - - /** - * The bottom left image. - */ - Glib::RefPtr bottomLeftBitmap; - - /** - * The bottom right image. - */ - Glib::RefPtr bottomRightBitmap; - - /** - * The default constructor. - */ - CornerBitmaps(void) throw () - { - } - - /** - * Constructor with image references. - * If any of the images is not available, the result is undefined. - * - * @param topLeftBitmap the top left bitmap of the border - * @param topRightBitmap the top right bitmap of the border - * @param bottomLeftBitmap the bottom left bitmap of the border - * @param bottomRightBitmap the bottom right bitmap of the border - */ - CornerBitmaps(Glib::RefPtr topLeftBitmap, - Glib::RefPtr topRightBitmap, - Glib::RefPtr bottomLeftBitmap, - Glib::RefPtr bottomRightBitmap) - throw () - { - this->topLeftBitmap = topLeftBitmap; - this->topRightBitmap = topRightBitmap; - this->bottomLeftBitmap = bottomLeftBitmap; - this->bottomRightBitmap = bottomRightBitmap; - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~CornerBitmaps(void) throw () - { - } - - -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_CornerBitmaps_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/MetadataComboBoxText.h b/src/modules/widgets/include/LiveSupport/Widgets/MetadataComboBoxText.h deleted file mode 100644 index 2d793d0f8..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/MetadataComboBoxText.h +++ /dev/null @@ -1,121 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_MetadataComboBoxText_h -#define LiveSupport_Widgets_MetadataComboBoxText_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/MetadataTypeContainer.h" -#include "LiveSupport/Widgets/ComboBoxText.h" - - -namespace LiveSupport { -namespace Widgets { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A combo box holding all possible metadata type entries. - */ -class MetadataComboBoxText : public ComboBoxText -{ - private: - - /** - * The list of metadata types. - */ - Ptr::Ref metadataTypes; - - - public: - - /** - * Constructor to be used with Glade::Xml::get_widget_derived(). - * - * @param baseClass widget of the parent class, created by Glade. - * @param glade the Glade object. - */ - MetadataComboBoxText( - GtkComboBox * baseClass, - const Glib::RefPtr & glade) - throw (); - /** - * A virtual destructor. - */ - virtual - ~MetadataComboBoxText(void) throw (); - - /** - * Set up the contents of the combo box. - * - * @param metadataTypes contains the metadata keys and values. - */ - void - setContents(Ptr::Ref metadataTypes) - throw (); - - /** - * Get the DC name for the currently selected metadata type. - * This is either a standard Dublin Core metadata type like - * "dc:title" or "dc:creator", or one of the Campcaster - * (née LiveSupport) extensions like "ls:year" or "ls:bpm". - * See the Studio config files for a list of all metadata types. - * - * @return the DC name for the current selection. - */ - Ptr::Ref - getActiveKey(void) - throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_MetadataComboBoxText_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/OperatorComboBoxText.h b/src/modules/widgets/include/LiveSupport/Widgets/OperatorComboBoxText.h deleted file mode 100644 index 21bacf533..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/OperatorComboBoxText.h +++ /dev/null @@ -1,109 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_OperatorComboBoxText_h -#define LiveSupport_Widgets_OperatorComboBoxText_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/ComboBoxText.h" - - -namespace LiveSupport { -namespace Widgets { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A combo box holding all possible search operator entries. - */ -class OperatorComboBoxText : public ComboBoxText, - public LocalizedObject -{ - public: - - /** - * Constructor to be used with Glade::Xml::get_widget_derived(). - * - * @param baseClass widget of the parent class, created by Glade. - * @param glade the Glade object. - */ - OperatorComboBoxText( - GtkComboBox * baseClass, - const Glib::RefPtr & glade) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~OperatorComboBoxText(void) throw (); - - /** - * Set up the contents of the combo box. - * - * @param bundle the resource bundle which holds the localized - * operator names. - */ - void - setContents(Ptr::Ref bundle) - throw (); - /** - * Get the currently selected operator. - * This is one of "partial", "prefix", "=", "<=" or ">=". - * - * @return the current selection. - */ - Ptr::Ref - getActiveKey(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_OperatorComboBoxText_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/PlayableTreeModelColumnRecord.h b/src/modules/widgets/include/LiveSupport/Widgets/PlayableTreeModelColumnRecord.h deleted file mode 100644 index 58725aa11..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/PlayableTreeModelColumnRecord.h +++ /dev/null @@ -1,88 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_PlayableTreeModelColumnRecord_h -#define LiveSupport_Widgets_PlayableTreeModelColumnRecord_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Playable.h" -#include - - -namespace LiveSupport { -namespace Widgets { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A basic column record class for tree models with colorable rows and a - * (usually invisible) column of type Ptr::Ref. - */ -class PlayableTreeModelColumnRecord : public ZebraTreeModelColumnRecord -{ - public: - /** - * The column for the playable object shown in the row. - */ - Gtk::TreeModelColumn::Ref> playableColumn; - - /** - * Constructor. - */ - PlayableTreeModelColumnRecord(void) throw () - { - add(playableColumn); - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_PlayableTreeModelColumnRecord_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h b/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h deleted file mode 100644 index 8acda9296..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/WidgetConstants.h +++ /dev/null @@ -1,78 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author $ - Version : $Revision $ - Location : $URL $ - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_WidgetConstants_h -#define LiveSupport_Widgets_WidgetConstants_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -namespace LiveSupport { -namespace Widgets { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A collection of constants used by the widgets. - * - * @author $Author $ - * @version $Revision $ - */ -class WidgetConstants -{ - public: - - /** - * The list of available miscellaneous images. - */ - typedef enum { audioClipIconImage, - playlistIconImage } ImageType; -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_WidgetConstants_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h b/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h deleted file mode 100644 index 4b42a813a..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/WidgetFactory.h +++ /dev/null @@ -1,184 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_WidgetFactory_h -#define LiveSupport_Widgets_WidgetFactory_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Widgets/WidgetConstants.h" - - -namespace LiveSupport { -namespace Widgets { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A factory to provide access to some Campcaster Widgets. - * As of Aug 2007, it is only used to retrieve the audio clip and playlist - * icon images. It may be extended later, or it may be removed. - * - * The singleton instance of this class has to be configured with an XML - * element, which looks like the following: - * - *

- *  <widgetFactory>   path = "path/to/widget/images/"
- *  </>
- *  
- * - * The DTD for the above XML structure is: - * - *

- *  
- *  
- *  
- */ -class WidgetFactory : public Configurable -{ - private: - - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The path to load the images from for the widgets. - */ - std::string path; - - /** - * A container holding the miscallenous image pixbuf references. - */ - std::map > - imageTypePixbufs; - - /** - * The default constructor. - */ - WidgetFactory(void) throw () - { - } - - /** - * Load an image relative the path, and signal error if not found. - * - * @param imageName the name of the image, relative to path - * @return the loaded image - * @exception std::invalid_argument if the image was not found - */ - Glib::RefPtr - loadImage(const std::string imageName) - throw (std::invalid_argument); - - - public: - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~WidgetFactory(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - /** - * Return a smart pointer to a Gdk::Pixbuf holding a named image. - * - * @return the image. - */ - Glib::RefPtr - getPixbuf(WidgetConstants::ImageType imageName) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_WidgetFactory_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/ZebraCellRenderer.h b/src/modules/widgets/include/LiveSupport/Widgets/ZebraCellRenderer.h deleted file mode 100644 index a3f7e6481..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/ZebraCellRenderer.h +++ /dev/null @@ -1,113 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_ZebraCellRenderer_h -#define LiveSupport_Widgets_ZebraCellRenderer_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "gtkmm/cellrenderertext.h" - - -namespace LiveSupport { -namespace Widgets { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A custom cell renderer for blue-gray striped TreeView's. - * This is not used anywhere at the moment, but it's left in here because - * we will probably need (something like) this later. - */ -class ZebraCellRenderer : public Gtk::CellRendererText -{ - public: - /** - * Default constructor. - */ - ZebraCellRenderer() throw (); - - /** - * A virtual destructor. - */ - virtual ~ZebraCellRenderer() throw (); - - protected: - /** - * Calculate the size of the cell. - */ - virtual void get_size_vfunc(Gtk::Widget& widget, - const Gdk::Rectangle* cell_area, - int* x_offset, int* y_offset, - int* width, int* height) const - throw (); - - /** - * Draw the cell. - */ - virtual void render_vfunc(const Glib::RefPtr& window, - Gtk::Widget& widget, - const Gdk::Rectangle& background_area, - const Gdk::Rectangle& cell_area, - const Gdk::Rectangle& expose_area, - Gtk::CellRendererState flags) - throw (); - - /** - * The user clicked on the cell. - */ - virtual bool activate_vfunc(GdkEvent* event, - Gtk::Widget& widget, - const Glib::ustring& path, - const Gdk::Rectangle& background_area, - const Gdk::Rectangle& cell_area, - Gtk::CellRendererState flags) - throw (); - -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_ZebraCellRenderer_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeModelColumnRecord.h b/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeModelColumnRecord.h deleted file mode 100644 index 990df92c3..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeModelColumnRecord.h +++ /dev/null @@ -1,81 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_ZebraTreeModelColumnRecord_h -#define LiveSupport_Widgets_ZebraTreeModelColumnRecord_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -namespace LiveSupport { -namespace Widgets { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A basic column record class for tree models with colorable rows. - */ -class ZebraTreeModelColumnRecord : public Gtk::TreeModelColumnRecord -{ - public: - /** - * The column for the color of the row. - */ - Gtk::TreeModelColumn rowNumberColumn; - - /** - * Constructor. - */ - ZebraTreeModelColumnRecord(void) throw () - { - add(rowNumberColumn); - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_ZebraTreeModelColumnRecord_h - diff --git a/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h b/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h deleted file mode 100644 index 18275041c..000000000 --- a/src/modules/widgets/include/LiveSupport/Widgets/ZebraTreeView.h +++ /dev/null @@ -1,430 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveSupport_Widgets_ZebraTreeView_h -#define LiveSupport_Widgets_ZebraTreeView_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/WidgetConstants.h" - - -namespace LiveSupport { -namespace Widgets { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A table of items, in rows colored alternately gray and light blue. - * - * NOTE: the ZebraTreeView works only with models based on a - * ZebraTreeModelColumRecord column record, because cellDataFunction() - * and renumberRows() refer to the row number column of the model. - * AFAIK there is no way to syntactically enforce this, so you need to - * remember it. - * - * General comments about TreeViews: - * - * TreeViews contain TreeViewColumns; these contain a title (a text Label) - * and a table column body (a CellRenderer). The CellRenderer needs to be - * both 'added' to the TreeViewColumn, and 'connected' to a TreeModel - * column. - * - * A single TreeViewColumn may contain several CellRenderers, i.e., - * sub-columns. - * - * The standard CellRenderer types (CellRendererText etc) can not be - * instantiated by the user; they can only be created by the shortcut - * TreeViewColumn constructor or the append_column() or insert_column() - * functions in TreeView. These create the appropriate CellRenderer, - * add it the tree view column, and connect it with the tree model column. - * - * A derived CellRenderer sub-type needs to be 1) instantiated; - * 2) added to a TreeViewColumn using a constructor or pack_start() etc; - * 3) connected with a TreeModelColumn using TreeViewColumn::set_renderer(). - */ -class ZebraTreeView : public Gtk::TreeView -{ - private: - /** - * Default constructor. - */ - ZebraTreeView(void) throw () - { - } - - /** - * The callback function to set the colors of the rows. - * - * @param cell the cell renderer of the column. - * @param iter points to the current row in the model. - */ - void - cellDataFunction(Gtk::CellRenderer* cell, - const Gtk::TreeModel::iterator& iter) - throw (); - - /** - * The callback function for the line number columns. - * It reads the line number from the rowNumberColumn of the model. - * - * @param cell the cell renderer of the column. - * @param iter points to the current row in the model. - * @param offset the line number of the first row, set by the - * call to appendLineNumberColumn() - */ - void - lineNumberCellDataFunction( - Gtk::CellRenderer* cell, - const Gtk::TreeModel::iterator& iter, - int offset) - throw (); - - /** - * Emit the "cell has been edited" signal. - */ - void - emitSignalCellEdited(const Glib::ustring & path, - const Glib::ustring & newText, - int columnId) - throw () - { - signalCellEdited().emit(path, columnId, newText); - } - - /** - * Emit the "tree model has changed" signal. - */ - void - emitSignalTreeModelChanged(void) - throw () - { - signalTreeModelChanged().emit(); - } - - /** - * Renumber the rows after they have changed. - * - * This is called from the onRowInserted(), onRowDeleted() and - * onRowsReordered() signal handlers. - */ - void - renumberRows(void) throw (); - - /** - * Find the selected row. - * Returns the selected row (if the selection type is single), - * or the first selected row (if the selection type is multiple). - * May return 0 if no row is selected. - * - * @return an iterator pointing to the selected row; or 0. - */ - Gtk::TreeModel::iterator - getSelectedRow(void) throw (); - - - protected: - /** - * A signal object to notify people that a cell has been edited. - */ - sigc::signal signalCellEditedObject; - - /** - * A signal object to notify people that the tree model has changed. - */ - sigc::signal signalTreeModelChangedObject; - - /** - * Event handler for the row_inserted signal. - * - * @param path a path pointing to the inserted row. - * @param iter an iterator pointing to the inserted row. - */ - void - onRowInserted(const Gtk::TreeModel::Path & path, - const Gtk::TreeModel::iterator & iter) - throw (); - - /** - * Event handler for the row_deleted signal. - * - * @param path points to the previous location of the deleted row. - */ - void - onRowDeleted(const Gtk::TreeModel::Path & path) throw (); - - /** - * Event handler for the rows_reordered signal. - * - * @param path points to the tree node whose children have been - * reordered. - * @param iter points to the node whose children have been - * reordered, or 0 if the depth of path is 0. - * @param mapping an array of integers mapping the current position - * of each child to its old position before the - * re-ordering, i.e. mapping[newpos] = oldpos. - */ - void - onRowsReordered(const Gtk::TreeModel::Path & path, - const Gtk::TreeModel::iterator& iter, - int* mapping) - throw (); - - /** - * Event handler for the row_expanded signal. - * - * @param iter points to the expanded row. - * @param path points to the expanded row. - */ - void - onRowExpanded(const Gtk::TreeModel::iterator & iter, - const Gtk::TreeModel::Path & path) throw (); - - /** - * Event handler for the row_collapsed signal. - * - * @param iter points to the collapsed row. - * @param path points to the collapsed row. - */ - void - onRowCollapsed(const Gtk::TreeModel::iterator & iter, - const Gtk::TreeModel::Path & path) throw (); - - - public: - /** - * Constructor. - * - * @param treeModel the data the treeView will show. - */ - ZebraTreeView(Glib::RefPtr treeModel) - throw (); - - /** - * Constructor to be used with Glade::Xml::get_widget_derived(). - * - * @param baseClass widget of the parent class, created by Glade. - * @param glade the Glade object. - */ - ZebraTreeView(_GtkTreeView * baseClass, - const Glib::RefPtr & glade) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~ZebraTreeView(void) throw (); - - /** - * Add a text column to the TreeView. - * - * @param title the title of the column - * @param modelColumn the model column this view will display - * @param minimumWidth the minimum width of the column, in pixels - * (optional) - * @return the number of columns after adding this one - */ - int - appendColumn(const Glib::ustring& title, - const Gtk::TreeModelColumn& modelColumn, - int minimumWidth = 0) - throw (); - - /** - * Add an image column to the TreeView. - * - * @param title the title of the column - * @param modelColumn the model column this view will display - * @param minimumWidth the minimum width of the column, in pixels - * (optional) - * @return the number of columns after adding this one - */ - int - appendColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn > & - modelColumn, - int minimumWidth = 0) - throw (); - - /** - * Add a centered text column to the TreeView. - * - * @param title the title of the column - * @param modelColumn the model column this view will display - * @param minimumWidth the minimum width of the column, in pixels - * (optional) - * @return the number of columns after adding this one - */ - int - appendCenteredColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn& modelColumn, - int minimumWidth = 0) - throw (); - - /** - * Add a centered line number column to the TreeView. - * - * @param title the title of the column - * @param offset the line number of the first row - * @param minimumWidth the minimum width of the column, in pixels - * (optional) - * @return the number of columns after adding this one - */ - int - appendLineNumberColumn( - const Glib::ustring& title, - int offset = 0, - int minimumWidth = 0) - throw (); - - /** - * Add an editable text column to the TreeView. - * - * The signal_edited() signal of the cell renderer gets connected - * to the signalEdited() signal of the ZebraTreeView object; the - * columnId argument will get passed to the signal handler. - * - * This is used to display fade info (time durations), so the text is - * right aligned in the column. - * - * @param title the title of the column - * @param modelColumn the model column this view will display - * @param columnId the column ID passed to the signal handler - * @param minimumWidth the minimum width of the column, in pixels - * (optional) - * @return the number of columns after adding this one - */ - int - appendEditableColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn& modelColumn, - int columnId, - int minimumWidth = 0) - throw (); - - /** - * Signal handler for the "up" menu option selected from - * the context menu. - */ - void - onUpMenuOption(void) throw (); - - /** - * Signal handler for the "down" menu option selected from - * the context menu. - */ - void - onDownMenuOption(void) throw (); - - /** - * Signal handler for the "remove" menu option selected from - * the context menu. - */ - void - onRemoveMenuOption(void) throw (); - - /** - * Remove an item from the window. - * - * @param iter points to the row to be removed - */ - void - removeItem(const Gtk::TreeModel::iterator & iter) throw (); - - /** - * The signal raised when a cell has been edited. - * - * @return the signal object (a protected member of this class) - */ - sigc::signal - signalCellEdited(void) throw () - { - return signalCellEditedObject; - } - - /** - * The signal raised when the rows in the tree model have changed. - * This signal is emitted whenever the tree model emits a - * row_inserted, row_deleted or rows_reordered signal. - * - * @return the signal object (a protected member of this class) - */ - sigc::signal - signalTreeModelChanged(void) throw () - { - return signalTreeModelChangedObject; - } - - /** - * Manually connect the 'model has changed' signals to the tree view. - * This is useful if you want to use the same ZebraTreeView object - * to alternately display two (or more) different tree models. - * - * @param treeModel the tree model whose changes should trigger - * a redraw of the tree view object - */ - void - connectModelSignals(Glib::RefPtr treeModel) - throw (); - -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // LiveSupport_Widgets_ZebraTreeView_h - diff --git a/src/modules/widgets/lib/.keepme b/src/modules/widgets/lib/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/widgets/lib/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/widgets/src/Colors.cxx b/src/modules/widgets/src/Colors.cxx deleted file mode 100644 index a14d0e22a..000000000 --- a/src/modules/widgets/src/Colors.cxx +++ /dev/null @@ -1,132 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "gtkmm/widget.h" - -#include "LiveSupport/Widgets/Colors.h" - - -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * The vector holding the colors. - */ -std::map Colors :: colors; - -/** - * Clear the "initialized" flag. - */ -bool Colors :: initialized = false; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Load the colors. - *----------------------------------------------------------------------------*/ -void -Colors :: initialize(void) throw () -{ - Gdk::Color whiteColor ("#ffffff"); - Gdk::Color blackColor ("#000000"); - Gdk::Color lightBlueColor ("#cfdee7"); - Gdk::Color brightBlueColor ("#6fb0ff"); - Gdk::Color blueColor ("#9ebadb"); - Gdk::Color darkBlueColor ("#688597"); - Gdk::Color grayColor ("#eaeaea"); - Gdk::Color slateGrayColor ("#c7cdd3"); - Gdk::Color mediumBlueGrayColor ("#97bacf"); - Gdk::Color darkGrayColor ("#5a5a5a"); - Gdk::Color yellowColor ("#ffff99"); - Gdk::Color orangeColor ("#ff4b00"); - Gdk::Color redColor ("#ff4b4b"); - Gdk::Color masterPanelCenterBlueColor ("#99cdff"); - Gdk::Color liveModeRowBlueColor ("#cde0f1"); - - Glib::RefPtr colormap = Gtk::Widget::get_default_colormap(); - colormap->alloc_color(whiteColor); - colormap->alloc_color(blackColor); - colormap->alloc_color(lightBlueColor); - colormap->alloc_color(brightBlueColor); - colormap->alloc_color(blueColor); - colormap->alloc_color(darkBlueColor); - colormap->alloc_color(grayColor); - colormap->alloc_color(slateGrayColor); - colormap->alloc_color(mediumBlueGrayColor); - colormap->alloc_color(darkGrayColor); - colormap->alloc_color(yellowColor); - colormap->alloc_color(orangeColor); - colormap->alloc_color(redColor); - colormap->alloc_color(masterPanelCenterBlueColor); - colormap->alloc_color(liveModeRowBlueColor); - - colors[White] = whiteColor; - colors[Black] = blackColor; - colors[LightBlue] = lightBlueColor; - colors[BrightBlue] = brightBlueColor; - colors[Blue] = blueColor; - colors[DarkBlue] = darkBlueColor; - colors[Gray] = grayColor; - colors[SlateGray] = slateGrayColor; - colors[MediumBlueGray] = mediumBlueGrayColor; - colors[DarkGray] = darkGrayColor; - colors[Yellow] = yellowColor; - colors[Orange] = orangeColor; - colors[Red] = redColor; - colors[MasterPanelCenterBlue] - = masterPanelCenterBlueColor; - colors[LiveModeRowBlue] = liveModeRowBlueColor; - - initialized = true; -} - - -/*------------------------------------------------------------------------------ - * Get a color by its name. - *----------------------------------------------------------------------------*/ -const Gdk::Color& -Colors :: getColor(const ColorName& name) throw () -{ - if (!initialized) { - initialize(); - } - - return colors[name]; -} - diff --git a/src/modules/widgets/src/ComboBoxText.cxx b/src/modules/widgets/src/ComboBoxText.cxx deleted file mode 100644 index ef181d786..000000000 --- a/src/modules/widgets/src/ComboBoxText.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Widgets/ComboBoxText.h" - - -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ComboBoxText :: ComboBoxText( - GtkComboBox * baseClass, - const Glib::RefPtr & glade) - throw () - : Gtk::ComboBoxText(baseClass) -{ -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -ComboBoxText :: ~ComboBoxText(void) throw () -{ -} - diff --git a/src/modules/widgets/src/MetadataComboBoxText.cxx b/src/modules/widgets/src/MetadataComboBoxText.cxx deleted file mode 100644 index 8d56be668..000000000 --- a/src/modules/widgets/src/MetadataComboBoxText.cxx +++ /dev/null @@ -1,97 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Widgets/MetadataComboBoxText.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -MetadataComboBoxText :: MetadataComboBoxText( - GtkComboBox * baseClass, - const Glib::RefPtr & glade) - throw () - : ComboBoxText(baseClass, glade) -{ -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -MetadataComboBoxText :: ~MetadataComboBoxText(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Set up the contents of the combo box. - *----------------------------------------------------------------------------*/ -void -MetadataComboBoxText :: setContents( - Ptr::Ref metadataTypes) - throw () -{ - this->metadataTypes = metadataTypes; - - MetadataTypeContainer::Vector::const_iterator it; - for (it = metadataTypes->begin(); it != metadataTypes->end(); ++it) { - Ptr::Ref metadata = *it; - append_text(*metadata->getLocalizedName()); - } - set_active(0); // select the first item -} - - -/*------------------------------------------------------------------------------ - * Set up the contents of the combo box. - *----------------------------------------------------------------------------*/ -Ptr::Ref -MetadataComboBoxText :: getActiveKey(void) - throw () -{ - Ptr::Ref metadata = metadataTypes->getByIndex( - get_active_row_number()); - return metadata->getDcName(); -} - diff --git a/src/modules/widgets/src/OperatorComboBoxText.cxx b/src/modules/widgets/src/OperatorComboBoxText.cxx deleted file mode 100644 index e110f3424..000000000 --- a/src/modules/widgets/src/OperatorComboBoxText.cxx +++ /dev/null @@ -1,122 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Widgets/OperatorComboBoxText.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -OperatorComboBoxText :: OperatorComboBoxText( - GtkComboBox * baseClass, - const Glib::RefPtr & glade) - throw () - : ComboBoxText(baseClass, glade) -{ -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -OperatorComboBoxText :: ~OperatorComboBoxText(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Set up the contents of the combo box. - *----------------------------------------------------------------------------*/ -void -OperatorComboBoxText :: setContents(Ptr::Ref bundle) - throw () -{ - setBundle(bundle); - append_text(*getResourceUstring("partialOperatorDisplay")); - append_text(*getResourceUstring("prefixOperatorDisplay")); - append_text(*getResourceUstring("=OperatorDisplay")); - append_text(*getResourceUstring("<=OperatorDisplay")); - append_text(*getResourceUstring(">=OperatorDisplay")); - set_active(0); -} - - -/*------------------------------------------------------------------------------ - * Set up the contents of the combo box. - *----------------------------------------------------------------------------*/ -Ptr::Ref -OperatorComboBoxText :: getActiveKey(void) throw () -{ - Ptr::Ref selectedOperator(new Glib::ustring); - int selectedRow = get_active_row_number(); - - switch (selectedRow) { - case 0: selectedOperator->assign("partial"); - break; - - case 1: selectedOperator->assign("prefix"); - break; - - case 2: selectedOperator->assign("="); - break; - - case 3: selectedOperator->assign("<="); - break; - - case 4: selectedOperator->assign(">="); - break; - - default: std::cerr << "impossible value '" - << selectedRow - << "' in OperatorComboBoxText::getActiveKey" - << std::endl; - std::exit(1); - break; - } - - return selectedOperator; -} - diff --git a/src/modules/widgets/src/TestWindow.cxx b/src/modules/widgets/src/TestWindow.cxx deleted file mode 100644 index 4383b5784..000000000 --- a/src/modules/widgets/src/TestWindow.cxx +++ /dev/null @@ -1,472 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Widgets/WidgetFactory.h" -#include "LiveSupport/Widgets/Colors.h" -#include "TestWindow.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the configuration file for the resource bundle. - *----------------------------------------------------------------------------*/ -const std::string bundleConfigFileName = "etc/resourceBundle.xml"; - -/*------------------------------------------------------------------------------ - * The name of the Glade file. - *----------------------------------------------------------------------------*/ -const std::string gladeFileName = "var/glade/TestWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -TestWindow :: TestWindow (void) throw () -{ - configureBundle(); - - Glib::RefPtr glade = Gnome::Glade::Xml::create( - gladeFileName); - - glade->get_widget("mainWindow1", mainWindow); - mainWindow->set_title(*getResourceUstring("windowTitle")); - mainWindow->signal_delete_event().connect(sigc::mem_fun(*this, - &TestWindow::onDeleteEvent)); - - glade->get_widget_derived("combobox1", comboBox); - comboBox->append_text(*getResourceUstring("firstOption")); - comboBox->append_text(*getResourceUstring("secondOption")); - comboBox->append_text(*getResourceUstring("thirdOption")); - comboBox->set_active(0); - comboBox->signal_changed().connect(sigc::mem_fun(*this, - &TestWindow::onComboBoxSelectionChanged)); - - treeModel[0] = Gtk::ListStore::create(modelColumns); - glade->get_widget_derived("treeview1", treeView[0]); - treeView[0]->set_model(treeModel[0]); - treeView[0]->connectModelSignals(treeModel[0]); - treeView[0]->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); - treeView[0]->appendColumn(*getResourceUstring("pixbufColumnTitle"), - modelColumns.pixbufColumn); - treeView[0]->appendColumn(*getResourceUstring("textColumnTitle"), - modelColumns.textColumn); - fillTreeModel(0); - - treeModel[1] = Gtk::ListStore::create(modelColumns); - glade->get_widget_derived("treeview2", treeView[1]); - treeView[1]->set_model(treeModel[1]); - treeView[1]->connectModelSignals(treeModel[1]); - treeView[1]->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); - treeView[1]->appendColumn(*getResourceUstring("pixbufColumnTitle"), - modelColumns.pixbufColumn); - treeView[1]->appendColumn(*getResourceUstring("textColumnTitle"), - modelColumns.textColumn); - fillTreeModel(1); - - glade->get_widget("label1", label); - label->set_label(*getResourceUstring("dropHereText")); - - setupDndCallbacks(); - - glade->connect_clicked("button1", sigc::mem_fun(*this, - &TestWindow::onOkButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Configure the resource bundle. - *----------------------------------------------------------------------------*/ -void -TestWindow :: configureBundle (void) throw () -{ - Ptr::Ref bundle; - - try { - Ptr::Ref parser( - new xmlpp::DomParser(bundleConfigFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - - bundle = LocalizedObject::getBundle(*root); - - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in bundle configuration file:\n" - << e.what() << std::endl; - exit(1); - } catch (std::exception &e) { - std::cerr << "XML error in bundle configuration file:\n" - << e.what() << std::endl; - exit(1); - } - - setBundle(bundle); -} - - -/*------------------------------------------------------------------------------ - * Fill the left tree model. - *----------------------------------------------------------------------------*/ -void -TestWindow :: fillTreeModel (int index) throw () -{ - Ptr::Ref wf = WidgetFactory::getInstance(); - Glib::RefPtr pixbuf = wf->getPixbuf( - WidgetConstants::audioClipIconImage); - Gtk::TreeModel::Row row; - - treeModel[index]->clear(); - - if (index == 0) { - Glib::ustring text; - - switch (comboBox->get_active_row_number()) { - case -1: break; - - case 0: text = *getResourceUstring("textOne"); - break; - - case 1: text = *getResourceUstring("textTwo"); - break; - - case 2: text = *getResourceUstring("textThree"); - break; - - default: break; - } - - row = *treeModel[index]->append(); - row[modelColumns.pixbufColumn] = pixbuf; - row[modelColumns.textColumn] = text; - } - - row = *treeModel[index]->append(); - row[modelColumns.pixbufColumn] = pixbuf; - row[modelColumns.textColumn] = (index == 0) ? "1111111111" - : "AAAAAAAAAA"; - - row = *treeModel[index]->append(); - row[modelColumns.pixbufColumn] = pixbuf; - row[modelColumns.textColumn] = (index == 0) ? "2222222222" - : "BBBBBBBBBB"; - - row = *treeModel[index]->append(); - row[modelColumns.pixbufColumn] = pixbuf; - row[modelColumns.textColumn] = (index == 0) ? "3333333333" - : "CCCCCCCCCC"; - - row = *treeModel[index]->append(); - row[modelColumns.pixbufColumn] = pixbuf; - row[modelColumns.textColumn] = (index == 0) ? "4444444444" - : "EEEEEEEEEE"; -} - - -/*------------------------------------------------------------------------------ - * Set up the D'n'D callbacks. - *----------------------------------------------------------------------------*/ -void -TestWindow :: setupDndCallbacks (void) throw () -{ - std::list targets; - targets.push_back(Gtk::TargetEntry("STRING", - Gtk::TARGET_SAME_APP)); - - // set up the left tree view - treeView[0]->enable_model_drag_source(targets); - treeView[0]->signal_drag_data_get().connect(sigc::bind( - sigc::mem_fun(*this, - &TestWindow::onTreeViewDragDataGet), - 0)); - treeView[0]->enable_model_drag_dest(targets); - treeView[0]->signal_drag_data_received().connect(sigc::bind( - sigc::mem_fun(*this, - &TestWindow::onTreeViewDragDataReceived), - 0)); - - // set up the right tree view - treeView[1]->enable_model_drag_source(targets); - treeView[1]->signal_drag_data_get().connect(sigc::bind( - sigc::mem_fun(*this, - &TestWindow::onTreeViewDragDataGet), - 1)); - treeView[1]->enable_model_drag_dest(targets); - treeView[1]->signal_drag_data_received().connect(sigc::bind( - sigc::mem_fun(*this, - &TestWindow::onTreeViewDragDataReceived), - 1)); - - // set up the label - label->drag_dest_set(targets); - label->signal_drag_data_received().connect(sigc::mem_fun(*this, - &TestWindow::onLabelDragDataReceived)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for selection change in the combo box. - *----------------------------------------------------------------------------*/ -void -TestWindow :: onComboBoxSelectionChanged (void) throw () -{ - fillTreeModel(0); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the OK button being clicked. - *----------------------------------------------------------------------------*/ -void -TestWindow :: onOkButtonClicked (void) throw () -{ - std::cerr << "TestWindow::onOkButtonClicked() called." << std::endl; - mainWindow->hide(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the window being hidden. - *----------------------------------------------------------------------------*/ -bool -TestWindow :: onDeleteEvent (GdkEventAny * event) throw () -{ - // We could add a confirmation dialog here. - std::cerr << "TestWindow::onDeleteEvent() called." << std::endl; - return false; -} - - -/*------------------------------------------------------------------------------ - * Run the window. - *----------------------------------------------------------------------------*/ -void -TestWindow :: run (void) throw () -{ - Gtk::Main::run(*mainWindow); -} - - -/*------------------------------------------------------------------------------ - * The callback for the start of the drag. - *----------------------------------------------------------------------------*/ -void -TestWindow :: onTreeViewDragDataGet( - const Glib::RefPtr & context, - Gtk::SelectionData & selectionData, - guint info, - guint time, - int index) - throw () -{ - Glib::RefPtr selection - = treeView[index]->get_selection(); - std::list rows = selection->get_selected_rows(); - Glib::ustring dropString = leftOrRight(index); - // we can assume there is only one row selected, due to bug - // http://bugzilla.gnome.org/show_bug.cgi?id=70479 - assert (rows.size() == 1); - - Gtk::TreeRow row = *treeModel[index]->get_iter(rows.front()); - dropString += " "; - dropString += row[modelColumns.textColumn]; - - selectionData.set(selectionData.get_target(), - 8 /* 8 bits format*/, - (const guchar *) dropString.c_str(), - dropString.bytes()); -} - - -/*------------------------------------------------------------------------------ - * The callback for the end of the drag. - *----------------------------------------------------------------------------*/ -void -TestWindow :: onTreeViewDragDataReceived( - const Glib::RefPtr & context, - int x, - int y, - const Gtk::SelectionData & selectionData, - guint info, - guint time, - int index) - throw () -{ - if (selectionData.get_length() < 0 || selectionData.get_format() != 8) { - std::cerr << "unknown type of data dropped on " - << leftOrRight(index) - << " tree view" - << std::endl; - context->drag_finish(false, false, time); - return; - } - - Glib::ustring data = selectionData.get_data_as_string(); - Glib::ustring stripped; - - int source = -1; - int destination = index; - - if (data.find("left") == 0) { - std::cerr << "left -> " - << leftOrRight(index) - << ": " - << data.substr(5) - << std::endl; - stripped = data.substr(5); - source = 0; - - } else if (data.find("right") == 0) { - std::cerr << "right -> " - << leftOrRight(index) - << ": " - << data.substr(6) - << std::endl; - stripped = data.substr(6); - source = 1; - - } else { - std::cerr << "unknown string dropped on " - << leftOrRight(index) - << " tree view: " - << data - << std::endl; - context->drag_finish(false, false, time); - return; - } - - if (source == destination) { - insertRow(destination, x, y, stripped, ROW_MOVE); - context->drag_finish(true, true, time); - - } else { - insertRow(destination, x, y, stripped, ROW_COPY); - context->drag_finish(true, false, time); - } -} - - -/*------------------------------------------------------------------------------ - * Insert a string row into a tree view. - *----------------------------------------------------------------------------*/ -void -TestWindow :: insertRow (int index, - int x, - int y, - Glib::ustring value, - RowOperation operation) throw () -{ - Gtk::TreePath destPath; - Gtk::TreeViewDropPosition destPos; - bool pathIsValid = treeView[index]->get_dest_row_at_pos( - x, y, destPath, destPos); - // get_drag_dest_row() does not work here, for some strange reason - Gtk::TreeRow newRow; - - if (pathIsValid) { - assert (!destPath.empty()); - Gtk::TreeIter destination = treeModel[index]->get_iter(destPath); - - if (destPos == Gtk::TREE_VIEW_DROP_BEFORE - || destPos == Gtk::TREE_VIEW_DROP_INTO_OR_BEFORE) { - newRow = *treeModel[index]->insert(destination); - - } else if (destPos == Gtk::TREE_VIEW_DROP_AFTER - || destPos == Gtk::TREE_VIEW_DROP_INTO_OR_AFTER) { - newRow = *treeModel[index]->insert_after(destination); - - } else { - assert (false); - return; - } - } else { - newRow = *treeModel[index]->append(); - } - - Ptr::Ref wf = WidgetFactory::getInstance(); - Glib::RefPtr pixbuf = wf->getPixbuf( - WidgetConstants::audioClipIconImage); - newRow[modelColumns.pixbufColumn] = pixbuf; - newRow[modelColumns.textColumn] = value; - - if (operation == ROW_MOVE) { - Glib::RefPtr - selection = treeView[index]->get_selection(); - std::list - rows = selection->get_selected_rows(); - assert (rows.size() == 1); - Gtk::TreeIter source = treeModel[index]->get_iter(rows.front()); - - treeModel[index]->erase(source); - } -} - - -/*------------------------------------------------------------------------------ - * The callback for the end of the drag. - *----------------------------------------------------------------------------*/ -void -TestWindow :: onLabelDragDataReceived( - const Glib::RefPtr & context, - int x, - int y, - const Gtk::SelectionData & selectionData, - guint info, - guint time) - throw () -{ - if (selectionData.get_length() >= 0 && selectionData.get_format() == 8) { - Glib::ustring data = selectionData.get_data_as_string(); - label->set_label(data); - context->drag_finish(true, true, time); - - } else { - std::cerr << "unknown type of data dropped on the label" - << std::endl; - label->set_label(*getResourceUstring("dropHereText")); - context->drag_finish(false, false, time); - } -} - diff --git a/src/modules/widgets/src/TestWindow.h b/src/modules/widgets/src/TestWindow.h deleted file mode 100644 index f6b107062..000000000 --- a/src/modules/widgets/src/TestWindow.h +++ /dev/null @@ -1,288 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef TestWindow_h -#define TestWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Core/Ptr.h" - -#include "LiveSupport/Widgets/ComboBoxText.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" - - -namespace LiveSupport { -namespace Widgets { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A window, enabling interactive testing of UI components. - */ -class TestWindow : public LocalizedObject -{ - public: - - /** - * The possible DnD operations. - */ - typedef enum { ROW_COPY, - ROW_MOVE } RowOperation; - - - private: - - /** - * Configure the resource bundle. - */ - void - configureBundle (void) throw (); - - /** - * Fill one of the tree models. - * - * @param index which tree model to fill. - */ - void - fillTreeModel (int index) throw (); - - /** - * Set up the D'n'D callbacks. - */ - void - setupDndCallbacks (void) throw (); - - /** - * Return either "left" or "right". - * - * @param index 0 for left, 1 for right. - */ - Glib::ustring - leftOrRight (int index) throw () - { - if (index == 0) { - return "left"; - } else { - return "right"; - } - } - - /** - * Insert a string row into a tree view. - * - * @param index which tree view to work on. - * @param x the x coordinate of the location of the new row. - * @param y the y coordinate of the location of the new row. - * @param value the string to put into the new row. - * @param operation whether to copy or move the row. - */ - void - insertRow (int index, - int x, - int y, - Glib::ustring value, - RowOperation operation) throw (); - - - protected: - - /** - * The window itself. - */ - Gtk::Window * mainWindow; - - /** - * The combo box. - */ - ComboBoxText * comboBox; - - /** - * The tree views. - */ - ZebraTreeView * treeView[2]; - - /** - * The drop target label. - */ - Gtk::Label * label; - - /** - * The OK button. - */ - Gtk::Button * okButton; - - /** - * The columns model needed by Gtk::TreeView. - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - - /** - * A column showing a Pixbuf. - */ - Gtk::TreeModelColumn > - pixbufColumn; - - /** - * A text column. - */ - Gtk::TreeModelColumn textColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(pixbufColumn); - add(textColumn); - } - }; - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * The tree models, as GTK references. - */ - Glib::RefPtr treeModel[2]; - - /** - * Event handler for selection change in the combo box. - */ - virtual void - onComboBoxSelectionChanged (void) throw (); - - /** - * Event handler for the OK button being clicked. - */ - virtual void - onOkButtonClicked (void) throw (); - - /** - * Event handler for the window being hidden. - */ - virtual bool - onDeleteEvent (GdkEventAny * event) throw (); - - /** - * The callback for the start of the drag. - * - * @param index which tree view to drag from. - */ - virtual void - onTreeViewDragDataGet( - const Glib::RefPtr & context, - Gtk::SelectionData & selectionData, - guint info, - guint time, - int index) - throw (); - - /** - * The callback for the end of the drag. - * - * @param index which tree view to drop to. - */ - virtual void - onTreeViewDragDataReceived( - const Glib::RefPtr & context, - int x, - int y, - const Gtk::SelectionData & selectionData, - guint info, - guint time, - int index) - throw (); - - /** - * The callback for the end of the drag. - */ - virtual void - onLabelDragDataReceived( - const Glib::RefPtr & context, - int x, - int y, - const Gtk::SelectionData & selectionData, - guint info, - guint time) - throw (); - - - public: - - /** - * Constructor. - */ - TestWindow (void) throw (); - - /** - * Virtual destructor. - */ - virtual - ~TestWindow (void) throw () - { - } - - /** - * Run the window. - */ - void - run (void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Widgets -} // namespace LiveSupport - -#endif // TestWindow_h - diff --git a/src/modules/widgets/src/WidgetFactory.cxx b/src/modules/widgets/src/WidgetFactory.cxx deleted file mode 100644 index 88d092db6..000000000 --- a/src/modules/widgets/src/WidgetFactory.cxx +++ /dev/null @@ -1,156 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Widgets/WidgetFactory.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string WidgetFactory::configElementNameStr = "widgetFactory"; - -/*------------------------------------------------------------------------------ - * The singleton instance of WidgetFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref WidgetFactory::singleton; - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the attribute to get the path for the widget images. - *----------------------------------------------------------------------------*/ -const std::string pathAttrName = "path"; - -/*------------------------------------------------------------------------------ - * The relative path for the standard button images. - *----------------------------------------------------------------------------*/ -const std::string buttonPath = "button/"; - -/*------------------------------------------------------------------------------ - * The name of the image for the audio clip icon. - *----------------------------------------------------------------------------*/ -const std::string audioClipIconImageName = "icons/audioClipIcon.png"; - -/*------------------------------------------------------------------------------ - * The name of the image for the playlist icon. - *----------------------------------------------------------------------------*/ -const std::string playlistIconImageName = "icons/playlistIcon.png"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance to WidgetFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref -WidgetFactory :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new WidgetFactory()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the widget factory. - *----------------------------------------------------------------------------*/ -void -WidgetFactory :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - const xmlpp::Attribute * attribute = 0; - - if (!(attribute = element.get_attribute(pathAttrName))) { - throw std::invalid_argument("Missing path attribute"); - } - path = attribute->get_value(); - - imageTypePixbufs[WidgetConstants::audioClipIconImage] - = loadImage(audioClipIconImageName); - imageTypePixbufs[WidgetConstants::playlistIconImage] - = loadImage(playlistIconImageName); -} - - -/*------------------------------------------------------------------------------ - * Load an image - *----------------------------------------------------------------------------*/ -Glib::RefPtr -WidgetFactory :: loadImage(const std::string imageName) - throw (std::invalid_argument) -{ - Glib::RefPtr image; - - bool success = true; - try { - image = Gdk::Pixbuf::create_from_file(path + imageName); - } catch (Glib::FileError &e) { - success = false; - } catch (Gdk::PixbufError &e) { - success = false; - } - - if (!success || !image) { - throw std::invalid_argument("Missing " + imageName); - } - - return image; -} - - -/*------------------------------------------------------------------------------ - * Return a Gdk::Pixbuf reference to a named image - *----------------------------------------------------------------------------*/ -Glib::RefPtr -WidgetFactory :: getPixbuf(WidgetConstants::ImageType imageName) throw () -{ - return imageTypePixbufs[imageName]; -} - diff --git a/src/modules/widgets/src/ZebraCellRenderer.cxx b/src/modules/widgets/src/ZebraCellRenderer.cxx deleted file mode 100644 index 629bcb5fe..000000000 --- a/src/modules/widgets/src/ZebraCellRenderer.cxx +++ /dev/null @@ -1,252 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Widgets/ZebraCellRenderer.h" - - -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ZebraCellRenderer::ZebraCellRenderer() throw () -: - Glib::ObjectBase (typeid(ZebraCellRenderer)), - Gtk::CellRendererText () -{ -// std::cerr << "### constructor\n"; -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -ZebraCellRenderer::~ZebraCellRenderer() throw () -{ -// std::cerr << "### destructor\n"; -} - - -/*------------------------------------------------------------------------------ - * Calculate the size of the cell. - *----------------------------------------------------------------------------*/ -void -ZebraCellRenderer::get_size_vfunc(Gtk::Widget& widget, - const Gdk::Rectangle* cell_area, - int* x_offset, int* y_offset, - int* width, int* height) const - throw () -{ -/* - std::cerr << "### get_size_vfunc():" - << (cell_area ? cell_area->get_x() : -1) << ", " - << (cell_area ? cell_area->get_y() : -1) << "; " - << (cell_area ? cell_area->get_width() : -1) << ", " - << (cell_area ? cell_area->get_height() : -1) << "; " - << (x_offset ? *x_offset : -1) << ", " - << (y_offset ? *y_offset : -1) << " --- " - << (width ? *width : -1) << ", " - << (height ? *height : -1) << "\n"; -*/ - // call the parent method - Gtk::CellRendererText::get_size_vfunc(widget, cell_area, - x_offset, y_offset, - width, height); -/* - std::cerr << "... done: " - << (cell_area ? cell_area->get_x() : -1) << ", " - << (cell_area ? cell_area->get_y() : -1) << "; " - << (cell_area ? cell_area->get_width() : -1) << ", " - << (cell_area ? cell_area->get_height() : -1) << "; " - << (x_offset ? *x_offset : -1) << ", " - << (y_offset ? *y_offset : -1) << " --- " - << (width ? *width : -1) << ", " - << (height ? *height : -1) << "\n"; -*/ -/* - enum { TOGGLE_WIDTH = 12 }; - - const int calc_width = property_xpad() * 2 + TOGGLE_WIDTH; - const int calc_height = property_ypad() * 2 + TOGGLE_WIDTH; - - if(width) - *width = calc_width; - - if(height) - *height = calc_height; - - if(cell_area) - { - if(x_offset) - { - *x_offset = int(property_xalign() * (cell_area->get_width() - calc_width)); - *x_offset = std::max(0, *x_offset); - } - - if(y_offset) - { - *y_offset = int(property_yalign() * (cell_area->get_height() - calc_height)); - *y_offset = std::max(0, *y_offset); - } - } -*/ -} - - -/*------------------------------------------------------------------------------ - * Draw the cell. - *----------------------------------------------------------------------------*/ -void -ZebraCellRenderer::render_vfunc(const Glib::RefPtr& window, - Gtk::Widget& widget, - const Gdk::Rectangle& background_area, - const Gdk::Rectangle& cell_area, - const Gdk::Rectangle& expose_area, - Gtk::CellRendererState flags) - throw () -{ -/* - std::cerr << "### render_vfunc(): " - << widget.get_name() << " --- " - << background_area.get_x() << ", " - << background_area.get_y() << "; " - << background_area.get_width() << ", " - << background_area.get_height() << " -- " - << cell_area.get_x() << ", " - << cell_area.get_y() << "; " - << cell_area.get_width() << ", " - << cell_area.get_height() << "; " - << expose_area.get_x() << " -- " - << expose_area.get_y() << "; " - << expose_area.get_width() << ", " - << expose_area.get_height() << " -- " - << flags << "\n"; -*/ - // call the parent function - Gtk::CellRendererText::render_vfunc(window, widget, background_area, - cell_area, expose_area, flags); -/* - const unsigned int cell_xpad = property_xpad(); - const unsigned int cell_ypad = property_ypad(); - - int x_offset = 0, y_offset = 0, width = 0, height = 0; - get_size(widget, cell_area, x_offset, y_offset, width, height); - - width -= cell_xpad * 2; - height -= cell_ypad * 2; - - if(width <= 0 || height <= 0) - return; - - Gtk::StateType state = Gtk::STATE_INSENSITIVE; - - if(property_activatable_) - state = Gtk::STATE_NORMAL; - - if((flags & Gtk::CELL_RENDERER_SELECTED) != 0) - state = (widget.has_focus()) ? Gtk::STATE_SELECTED : Gtk::STATE_ACTIVE; - - const Gtk::ShadowType shadow = (property_active_) ? Gtk::SHADOW_IN : Gtk::SHADOW_OUT; - - //Cast the drawable to a Window. TODO: Maybe paint_option() should take a Drawable? murrayc. - Glib::RefPtr window_casted = Glib::RefPtr::cast_dynamic<>(window); - if(window_casted) - { - if(property_radio_) - { - widget.get_style()->paint_option( - window_casted, state, shadow, - cell_area, widget, "cellradio", - cell_area.get_x() + x_offset + cell_xpad, - cell_area.get_y() + y_offset + cell_ypad, - width - 1, height - 1); - } - else - { - widget.get_style()->paint_check( - window_casted, state, shadow, - cell_area, widget, "cellcheck", - cell_area.get_x() + x_offset + cell_xpad, - cell_area.get_y() + y_offset + cell_ypad, - width - 1, height - 1); - } - } -*/ -} - - -/*------------------------------------------------------------------------------ - * The user clicked on the cell. - *----------------------------------------------------------------------------*/ -bool -ZebraCellRenderer::activate_vfunc(GdkEvent* event, - Gtk::Widget& widget, - const Glib::ustring& path, - const Gdk::Rectangle& background_area, - const Gdk::Rectangle& cell_area, - Gtk::CellRendererState flags) - throw () -{ -/* - std::cerr << "### activate_vfunc(): " - << widget.get_name() << ", " - << path << ", " -// << background_area << ", " -// << cell_area << ", " - << flags << "\n"; -*/ - // call the parent function - return Gtk::CellRendererText::activate_vfunc(event, widget, path, - background_area, cell_area, flags); -/* - std::cerr << "... done.\n"; -*/ -/* - if(property_activatable_) - { - signal_toggled_(path); - return true; - } - - return false; -*/ -} diff --git a/src/modules/widgets/src/ZebraTreeView.cxx b/src/modules/widgets/src/ZebraTreeView.cxx deleted file mode 100644 index 18cc4357b..000000000 --- a/src/modules/widgets/src/ZebraTreeView.cxx +++ /dev/null @@ -1,572 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Widgets/WidgetFactory.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/Colors.h" - -#include "LiveSupport/Widgets/ZebraTreeView.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ZebraTreeView :: ZebraTreeView(Glib::RefPtr treeModel) - throw () - : Gtk::TreeView(treeModel) -{ - connectModelSignals(treeModel); - this->signal_row_expanded().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowExpanded)); - this->signal_row_collapsed().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowCollapsed)); -} - - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ZebraTreeView :: ZebraTreeView( - _GtkTreeView * baseClass, - const Glib::RefPtr & glade) - throw () - : Gtk::TreeView(baseClass) -{ - this->signal_row_expanded().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowExpanded)); - this->signal_row_collapsed().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowCollapsed)); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -ZebraTreeView :: ~ZebraTreeView(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Add a text column to the TreeView. - *----------------------------------------------------------------------------*/ -int -ZebraTreeView :: appendColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn& modelColumn, - int minimumWidth) - throw () -{ - // a standard cell renderer; can be replaced with a ZebraCellRenderer - Gtk::CellRendererText* renderer = Gtk::manage(new Gtk::CellRendererText); - - // the constructor packs the renderer into the TreeViewColumn - Gtk::TreeViewColumn* viewColumn = Gtk::manage( - new Gtk::TreeViewColumn(title, *renderer) ); - - // and then we associate this renderer with the model column - viewColumn->add_attribute(renderer->property_markup(), modelColumn); - - // this cell data function will do the blue-gray zebra stripes - viewColumn->set_cell_data_func( - *renderer, - sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) ); - - // set the minimum width of the column - if (minimumWidth) { - viewColumn->set_min_width(minimumWidth); - } - - return append_column(*viewColumn); -} - - -/*------------------------------------------------------------------------------ - * Add an image column to the TreeView. - *----------------------------------------------------------------------------*/ -int -ZebraTreeView :: appendColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn > & - modelColumn, - int minimumWidth) - throw () -{ - // a standard cell renderer; can be replaced with a ZebraCellRenderer - Gtk::CellRendererPixbuf* renderer = Gtk::manage( - new Gtk::CellRendererPixbuf ); - - // the constructor packs the renderer into the TreeViewColumn - Gtk::TreeViewColumn* viewColumn = Gtk::manage( - new Gtk::TreeViewColumn(title, *renderer) ); - - // and then we associate this renderer with the model column - viewColumn->add_attribute(renderer->property_pixbuf(), modelColumn); - - // this cell data function will do the blue-gray zebra stripes - viewColumn->set_cell_data_func( - *renderer, - sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) ); - - // set the minimum width of the column - if (minimumWidth) { - viewColumn->set_min_width(minimumWidth); - } - - return append_column(*viewColumn); -} - - -/*------------------------------------------------------------------------------ - * The callback function. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: cellDataFunction(Gtk::CellRenderer* cell, - const Gtk::TreeModel::iterator& iter) - throw () -{ - ZebraTreeModelColumnRecord model; - Colors::ColorName colorName = (*iter)[model.rowNumberColumn] % 2 - ? Colors::Gray - : Colors::LightBlue; - cell->property_cell_background_gdk() = Colors::getColor(colorName); -} - - -/*------------------------------------------------------------------------------ - * Add a centered text column to the TreeView. - *----------------------------------------------------------------------------*/ -int -ZebraTreeView :: appendCenteredColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn& modelColumn, - int minimumWidth) - throw () -{ - // a standard cell renderer; can be replaced with a ZebraCellRenderer - Gtk::CellRendererText* renderer = Gtk::manage(new Gtk::CellRendererText); - - // center the text in the column - renderer->property_xalign() = 0.5; - - // the constructor packs the renderer into the TreeViewColumn - Gtk::TreeViewColumn* viewColumn = Gtk::manage( - new Gtk::TreeViewColumn(title, *renderer) ); - - // and then we associate this renderer with the model column - viewColumn->add_attribute(renderer->property_markup(), modelColumn); - - // this cell data function will do the blue-gray zebra stripes - viewColumn->set_cell_data_func( - *renderer, - sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) ); - - // set the minimum width of the column - if (minimumWidth) { - viewColumn->set_min_width(minimumWidth); - } - - return append_column(*viewColumn); -} - - -/*------------------------------------------------------------------------------ - * Add a centered line number column to the TreeView. - *----------------------------------------------------------------------------*/ -int -ZebraTreeView :: appendLineNumberColumn( - const Glib::ustring& title, - int offset, - int minimumWidth) - throw () -{ - // a standard cell renderer; can be replaced with a ZebraCellRenderer - Gtk::CellRendererText* renderer = Gtk::manage(new Gtk::CellRendererText); - - // center the text in the column - renderer->property_xalign() = 0.5; - - // the constructor packs the renderer into the TreeViewColumn - Gtk::TreeViewColumn* viewColumn = Gtk::manage( - new Gtk::TreeViewColumn(title, *renderer) ); - - // this cell data function will do the blue-gray zebra stripes - // and fill in the line number from the model.rowNumberColumn - viewColumn->set_cell_data_func( - *renderer, - sigc::bind( - sigc::mem_fun(*this, &ZebraTreeView::lineNumberCellDataFunction), - offset )); - - // set the minimum width of the column - if (minimumWidth) { - viewColumn->set_min_width(minimumWidth); - } - - return append_column(*viewColumn); -} - - -/*------------------------------------------------------------------------------ - * The callback function for the line number column(s). - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: lineNumberCellDataFunction( - Gtk::CellRenderer* cell, - const Gtk::TreeModel::iterator& iter, - int offset) - throw () -{ - ZebraTreeModelColumnRecord model; - int rowNumber = (*iter)[model.rowNumberColumn]; - - Colors::ColorName colorName = rowNumber % 2 ? Colors::Gray - : Colors::LightBlue; - cell->property_cell_background_gdk() = Colors::getColor(colorName); - cell->property_cell_background_gdk() = Colors::getColor(colorName); - - Glib::ustring numberString; - numberString.append(""); - std::stringstream numberStr; - numberStr << (rowNumber + offset); - numberString.append(numberStr.str()); - numberString.append(""); - Gtk::CellRendererText * textCell - = dynamic_cast(cell); - textCell->property_markup() = numberString; -} - - -/*------------------------------------------------------------------------------ - * Add an editable centered text column to the TreeView. - *----------------------------------------------------------------------------*/ -int -ZebraTreeView :: appendEditableColumn( - const Glib::ustring& title, - const Gtk::TreeModelColumn& modelColumn, - int columnId, - int minimumWidth) - throw () -{ - // a standard cell renderer; can be replaced with a ZebraCellRenderer - Gtk::CellRendererText* renderer = Gtk::manage(new Gtk::CellRendererText); - - // right align the text in the column - renderer->property_xalign() = 1; - - // set the cells to be editable, and connect the signal to our own - renderer->property_editable() = true; - renderer->signal_edited().connect(sigc::bind( - sigc::mem_fun(*this, &ZebraTreeView::emitSignalCellEdited), - columnId )); - - // the constructor packs the renderer into the TreeViewColumn - Gtk::TreeViewColumn* viewColumn = Gtk::manage( - new Gtk::TreeViewColumn(title, *renderer) ); - - // and then we associate this renderer with the model column - viewColumn->add_attribute(renderer->property_markup(), modelColumn); - - // this cell data function will do the blue-gray zebra stripes - viewColumn->set_cell_data_func( - *renderer, - sigc::mem_fun(*this, &ZebraTreeView::cellDataFunction) ); - - // set the minimum width of the column - if (minimumWidth) { - viewColumn->set_min_width(minimumWidth); - } - - return append_column(*viewColumn); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Up menu item selected from the entry conext menu - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onUpMenuOption(void) throw () -{ - Gtk::TreeModel::iterator iter = getSelectedRow(); - - Glib::RefPtr treeModel - = Glib::RefPtr::cast_dynamic(get_model()); - ZebraTreeModelColumnRecord modelColumns; - - if (iter && iter != treeModel->children().begin()) { - Gtk::TreeModel::iterator previous = iter; - --previous; - - int rowNumber = (*previous)[modelColumns.rowNumberColumn]; - (*iter) [modelColumns.rowNumberColumn] = rowNumber; - (*previous)[modelColumns.rowNumberColumn] = ++rowNumber; - - treeModel->iter_swap(previous, iter); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Down menu item selected from the entry conext menu - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onDownMenuOption(void) throw () -{ - Gtk::TreeModel::iterator iter = getSelectedRow(); - - Glib::RefPtr treeModel - = Glib::RefPtr::cast_dynamic(get_model()); - ZebraTreeModelColumnRecord modelColumns; - - if (iter) { - Gtk::TreeModel::iterator next = iter; - ++next; - if (next != treeModel->children().end()) { - - int rowNumber = (*iter)[modelColumns.rowNumberColumn]; - (*next)[modelColumns.rowNumberColumn] = rowNumber; - (*iter)[modelColumns.rowNumberColumn] = ++rowNumber; - - treeModel->iter_swap(iter, next); - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Remove menu item selected from the entry conext menu - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onRemoveMenuOption(void) throw () -{ - Glib::RefPtr selection = get_selection(); - Gtk::TreeModel::iterator newSelection; - - if (selection->get_mode() == Gtk::SELECTION_SINGLE) { - Gtk::TreeModel::iterator it = selection->get_selected(); - if (it) { - newSelection = it; - ++newSelection; - removeItem(it); - } - - } else { - std::vector selectedPaths - = selection->get_selected_rows(); - - std::vector selectedIters; - std::vector::iterator pathIt = selectedPaths.begin(); - for ( ; pathIt != selectedPaths.end(); ++pathIt) { - selectedIters.push_back(get_model()->get_iter(*pathIt)); - } - - std::vector::iterator - iterIt = selectedIters.begin(); - for ( ; iterIt != selectedIters.end(); ++iterIt) { - newSelection = *iterIt; - ++newSelection; - removeItem(*iterIt); - } - - } - - if (newSelection) { - selection->select(newSelection); - } -} - - -/*------------------------------------------------------------------------------ - * Remove an item from the window. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: removeItem(const Gtk::TreeModel::iterator & iter) - throw () -{ - Glib::RefPtr treeModel - = Glib::RefPtr::cast_dynamic(get_model()); - treeModel->erase(iter); -} - - -/*------------------------------------------------------------------------------ - * Find the selected row. - *----------------------------------------------------------------------------*/ -Gtk::TreeModel::iterator -ZebraTreeView :: getSelectedRow(void) throw () -{ - Glib::RefPtr selection = get_selection(); - std::vector selectedRows; - Gtk::TreeModel::iterator it; - - switch (selection->get_mode()) { - case Gtk::SELECTION_SINGLE: - it = selection->get_selected(); - break; - - case Gtk::SELECTION_MULTIPLE: - selectedRows = selection->get_selected_rows(); - if (selectedRows.size() > 0) { - it = get_model()->get_iter(selectedRows.front()); - } - break; - - default: - break; - } - - return it; -} - - -/*------------------------------------------------------------------------------ - * Event handler for the row_inserted signal. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onRowInserted(const Gtk::TreeModel::Path & path, - const Gtk::TreeModel::iterator & iter) - throw () -{ - renumberRows(); - columns_autosize(); - emitSignalTreeModelChanged(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the row_deleted signal. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onRowDeleted(const Gtk::TreeModel::Path & path) - throw () -{ - renumberRows(); - columns_autosize(); - emitSignalTreeModelChanged(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the rows_reordered signal. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onRowsReordered(const Gtk::TreeModel::Path & path, - const Gtk::TreeModel::iterator & iter, - int* mapping) - throw () -{ - renumberRows(); - emitSignalTreeModelChanged(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the row_expanded signal. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onRowExpanded(const Gtk::TreeModel::iterator & iter, - const Gtk::TreeModel::Path & path) - throw () -{ - renumberRows(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the row_collapsed signal. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: onRowCollapsed(const Gtk::TreeModel::iterator & iter, - const Gtk::TreeModel::Path & path) - throw () -{ - renumberRows(); -} - - -/*------------------------------------------------------------------------------ - * Renumber the rows after they have changed. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: renumberRows(void) throw () -{ - Glib::RefPtr treeModel = get_model(); - ZebraTreeModelColumnRecord modelColumns; - int rowNumber = 0; - Gtk::TreeModel::iterator iter; - Gtk::TreeModel::iterator it; - - for (iter = treeModel->children().begin(); - iter != treeModel->children().end(); ++iter) { - Gtk::TreeRow row = *iter; - row[modelColumns.rowNumberColumn] = rowNumber++; - - if (row_expanded(treeModel->get_path(row))) { - for (it = row.children().begin(); it != row.children().end(); - ++it) { - Gtk::TreeRow childRow = *it; - childRow[modelColumns.rowNumberColumn] = rowNumber++; - } - } - } -} - - -/*------------------------------------------------------------------------------ - * Manually connect the 'model has changed' signals to the tree view. - *----------------------------------------------------------------------------*/ -void -ZebraTreeView :: connectModelSignals(Glib::RefPtr treeModel) - throw () -{ - treeModel->signal_row_inserted().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowInserted)); - treeModel->signal_row_deleted().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowDeleted)); - treeModel->signal_rows_reordered().connect(sigc::mem_fun(*this, - &ZebraTreeView::onRowsReordered)); -} - diff --git a/src/modules/widgets/src/main.cxx b/src/modules/widgets/src/main.cxx deleted file mode 100644 index 407704c7e..000000000 --- a/src/modules/widgets/src/main.cxx +++ /dev/null @@ -1,203 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/** @file - * This file is the main entry point for the TestWindow in the Widgets module. - */ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/WidgetFactory.h" -#include "TestWindow.h" - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * Our copyright notice, should be at most 80 columns - */ -static const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -static const char options[] = "c:hv"; - -/** - * Structure describing the long options - */ -static const struct option longOptions[] = { - { "config", required_argument, 0, 'c' }, - { "help", no_argument, 0, 'h' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; - - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -static void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -static void -printUsage ( const char invocation[], - std::ostream & os ); - - -/* ============================================================= module code */ - -/** - * Program entry point. - * - * @param argc the number of command line arguments passed by the user. - * @param argv the command line arguments passed by the user. - * @return 0 on success, non-0 on failure. - */ -int main ( int argc, - char * argv[] ) -{ - // initialize the Gtk library, with the Gtk options first - Gtk::Main kit(argc, argv); - - // take a look at our options - int i; - std::string configFileName; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'c': - configFileName = optarg; - break; - - case 'h': - printUsage(argv[0], std::cout); - exit(EXIT_SUCCESS); - - case 'v': - printVersion(std::cout); - exit(EXIT_SUCCESS); - - default: - printUsage(argv[0], std::cout); - exit(EXIT_FAILURE); - } - } - - if (optind != argc) { - printUsage(argv[0], std::cout); - exit(EXIT_FAILURE); - } - - std::cerr << "using config file '" << configFileName << '\'' << std::endl; - - Ptr::Ref widgetFactory = WidgetFactory::getInstance(); - - try { - std::auto_ptr - parser(new xmlpp::DomParser(configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - widgetFactory->configure(*(document->get_root_node())); - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in configuration file" << std::endl - << e.what() << std::endl; - exit(EXIT_FAILURE); - } catch (xmlpp::exception &e) { - std::cerr << "error parsing configuration file" << std::endl - << e.what() << std::endl; - exit(EXIT_FAILURE); - } - - { - TestWindow testWindow; - testWindow.run(); - } - - exit(EXIT_SUCCESS); -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -static void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -static void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION]" - << std::endl - << " mandatory options:" << std::endl - << " -c, --config=file.name scheduler configuration file" << std::endl - << " optional options:" << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/modules/widgets/tmp/.keepme b/src/modules/widgets/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/modules/widgets/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/modules/widgets/var/en.txt b/src/modules/widgets/var/en.txt deleted file mode 100644 index d59f768a0..000000000 --- a/src/modules/widgets/var/en.txt +++ /dev/null @@ -1,3 +0,0 @@ -en:table -{ -} diff --git a/src/modules/widgets/var/glade/TestWindow.glade b/src/modules/widgets/var/glade/TestWindow.glade deleted file mode 100644 index a40916e9f..000000000 --- a/src/modules/widgets/var/glade/TestWindow.glade +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - 500 - 300 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - - False - False - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GDK_EXTENSION_EVENTS_CURSOR - True - True - True - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - True - - - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - drag target - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - -5 - - - - - False - False - 2 - - - - - - diff --git a/src/modules/widgets/var/hu.txt b/src/modules/widgets/var/hu.txt deleted file mode 100644 index 066dc5ff3..000000000 --- a/src/modules/widgets/var/hu.txt +++ /dev/null @@ -1,18 +0,0 @@ -hu:table -{ - windowTitle:string { "Próbaablak" } - - pixbufColumnTitle:string { "Kép" } - textColumnTitle:string { "Szöveg" } - - firstOption:string { "Első lehetőség" } - secondOption:string { "Második lehetőség" } - thirdOption:string { "Harmadik lehetőség" } - - textOne:string { "Egy - megérett a meggy." } - textTwo:string { "Kettő - csipkebokor vessző." } - textThree:string { "Három - te leszel a párom. " } - - dropHereText:string { "Ide lehet húzni dolgokat." } -} - diff --git a/src/modules/widgets/var/icons/audioClipIcon.png b/src/modules/widgets/var/icons/audioClipIcon.png deleted file mode 100644 index f7adf90a8..000000000 Binary files a/src/modules/widgets/var/icons/audioClipIcon.png and /dev/null differ diff --git a/src/modules/widgets/var/icons/playlistIcon.png b/src/modules/widgets/var/icons/playlistIcon.png deleted file mode 100644 index 2f41a4678..000000000 Binary files a/src/modules/widgets/var/icons/playlistIcon.png and /dev/null differ diff --git a/src/modules/widgets/var/root.txt b/src/modules/widgets/var/root.txt deleted file mode 100644 index f0e429c85..000000000 --- a/src/modules/widgets/var/root.txt +++ /dev/null @@ -1,18 +0,0 @@ -root:table -{ - windowTitle:string { "Test Window" } - - pixbufColumnTitle:string { "Pixbuf" } - textColumnTitle:string { "Text" } - - firstOption:string { "First option" } - secondOption:string { "Second option" } - thirdOption:string { "Third option" } - - textOne:string { "When I was One, I had just begun." } - textTwo:string { "When I was Two, I was nearly new." } - textThree:string { "When I was Three, I was hardly me." } - - dropHereText:string { "You can drop things here." } -} - diff --git a/src/products/gLiveSupport/bin/autogen.sh b/src/products/gLiveSupport/bin/autogen.sh deleted file mode 100755 index 8360c7525..000000000 --- a/src/products/gLiveSupport/bin/autogen.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="campcaster-studio" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -echo " aclocal $ACLOCAL_FLAGS" -cp -f ${configure_ac} ${tmpdir} -cp -f ${etcdir}/acinclude.m4 ${tmpdir} -aclocal $ACLOCAL_FLAGS - -echo " autoheader ${configure_ac}" -autoheader ${configure_ac} - -echo " autoconf -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/products/gLiveSupport/bin/campcaster-studio.sh b/src/products/gLiveSupport/bin/campcaster-studio.sh deleted file mode 100755 index 06083a6d6..000000000 --- a/src/products/gLiveSupport/bin/campcaster-studio.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Invoke script for Campcaster Studio. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -libdir=$basedir/lib -tmpdir=$basedir/tmp - - -#------------------------------------------------------------------------------- -# Set up the environment -#------------------------------------------------------------------------------- -export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH -export GST_REGISTRY=$etcdir/gst-registry.xml -studio_exe=$bindir/campcaster-studio - -if [ -f ~/.campcaster/campcaster-studio.xml ]; then - config_file=~/.campcaster/campcaster-studio.xml -elif [ -f $etcdir/campcaster-studio.xml ]; then - config_file=$etcdir/campcaster-studio.xml -else - echo "Can't find configuration file."; -fi - -$studio_exe --version - -echo "using configuration file: $config_file"; - -$studio_exe -c $config_file diff --git a/src/products/gLiveSupport/bin/campcaster-studio_devenv.sh b/src/products/gLiveSupport/bin/campcaster-studio_devenv.sh deleted file mode 100755 index 68266ced1..000000000 --- a/src/products/gLiveSupport/bin/campcaster-studio_devenv.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Invoke script for Campcaster Studio. -# This script is only used in the Campcaster development environment. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -libdir=$basedir/lib -tmpdir=$basedir/tmp - -usrdir=`cd $basedir/../../../usr; pwd;` - - -#------------------------------------------------------------------------------- -# Set up the environment -#------------------------------------------------------------------------------- -export LD_LIBRARY_PATH=$usrdir/lib:$LD_LIBRARY_PATH - -if [ -x $tmpdir/campcaster-studio ]; then - studio_exe=$tmpdir/campcaster-studio -else - echo "Can't find scheduler executable."; -fi - -if [ -f ~/.campcaster/campcaster-studio.xml ]; then - config_file=~/.campcaster/campcaster-studio.xml -elif [ -f $etcdir/campcaster-studio.xml ]; then - config_file=$etcdir/campcaster-studio.xml -else - echo "Can't find configuration file."; -fi - -$studio_exe --version - -echo "using configuration file: $config_file"; - -$studio_exe -c $config_file diff --git a/src/products/gLiveSupport/bin/gen_coverage_data.sh b/src/products/gLiveSupport/bin/gen_coverage_data.sh deleted file mode 100755 index 159150a44..000000000 --- a/src/products/gLiveSupport/bin/gen_coverage_data.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script generates code coverage data for the module -#------------------------------------------------------------------------------- -module="Campcaster Studio" - -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -docdir=$basedir/doc -tmpdir=$basedir/tmp - -usrdir=`cd $basedir/../../../usr; pwd;` - -coverage_report_dir=$docdir/coverage - -raw_coverage_file=$tmpdir/raw_coverage.info -coverage_file=$tmpdir/coverage.info - -lcov=$usrdir/bin/lcov -genhtml=$usrdir/bin/genhtml - - -cd $basedir - -#------------------------------------------------------------------------------- -# Re-configure with covarege collection enabled, compile and run the tests -#------------------------------------------------------------------------------- -$bindir/autogen.sh --enable-coverage -make clean -make check - -#------------------------------------------------------------------------------- -# Generate some symlinks so that the sources are visible from tmpdir -#------------------------------------------------------------------------------- -ln -s $basedir/include $tmpdir/include -ln -s $basedir/src $tmpdir/src - - -#------------------------------------------------------------------------------- -# Use lcov to generate an HTML report on the coverage data -#------------------------------------------------------------------------------- -$lcov -d $tmpdir -c > $raw_coverage_file -$lcov -e $raw_coverage_file "$tmpdir/*" > $coverage_file -rm -rf $coverage_report_dir -mkdir -p $coverage_report_dir -$genhtml -t "$module" -o $coverage_report_dir $coverage_file - - -#------------------------------------------------------------------------------- -# Clean up -#------------------------------------------------------------------------------- -rm -f $tmpdir/include -rm -f $tmpdir/src diff --git a/src/products/gLiveSupport/configure b/src/products/gLiveSupport/configure deleted file mode 100755 index 26ccda218..000000000 --- a/src/products/gLiveSupport/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen $*) -fi - -(cd $tmpdir && $configure $*) - diff --git a/src/products/gLiveSupport/doc/.keepme b/src/products/gLiveSupport/doc/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/products/gLiveSupport/doc/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/products/gLiveSupport/etc/Makefile.in b/src/products/gLiveSupport/etc/Makefile.in deleted file mode 100644 index 680855aa8..000000000 --- a/src/products/gLiveSupport/etc/Makefile.in +++ /dev/null @@ -1,468 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# @configure_input@ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -CP = cp -f -SED = sed -ECHO = echo -CAT = cat - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -PACKAGE_NAME = @PACKAGE_NAME@ - -BASE_DIR = @builddir@ -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -BIN_DIR = ${BASE_DIR}/bin -ETC_DIR = ${BASE_DIR}/etc -SRC_DIR = ${BASE_DIR}/src -TMP_DIR = ${BASE_DIR}/tmp -VAR_DIR = ${BASE_DIR}/var - -REAL_BASE_DIR=$(shell cd ${BASE_DIR}; pwd) - - -prefix = @prefix@ - -USR_DIR = ${prefix} -USR_BIN_DIR = ${USR_DIR}/bin -USR_ETC_DIR = ${USR_DIR}/etc -USR_INCLUDE_DIR = ${USR_DIR}/include -USR_LIB_DIR = ${USR_DIR}/lib -USR_VAR_DIR = ${USR_DIR}/var -STORAGE_TMP_DIR = "/tmp" - -HOSTNAME = @HOSTNAME@ -WWW_PORT = @WWW_PORT@ -SCHEDULER_PORT = @SCHEDULER_PORT@ -DB_SERVER = @DB_SERVER@ -DATABASE = @DATABASE@ -DB_USER = @DB_USER@ -DB_PASSWORD = @DB_PASSWORD@ -AUDIO_OUT = "@AUDIO_OUT@" -AUDIO_CUE = "@AUDIO_CUE@" - -PHP_URL_PREFIX=campcaster -ALIB_XML_RPC_PREFIX=xmlrpc/xrLocStor.php -SCHEDULER_XML_RPC_PREFIX=RC2 -SCHEDULER_DAEMON_COMMAND="sudo ${USR_BIN_DIR}/campcaster-scheduler.sh" - -USR_VAR_DIR_S=$(shell ${ECHO} ${USR_VAR_DIR} | ${SED} -e "s/\//\\\\\\\\\//g") -PHP_URL_PREFIX_S=$(shell ${ECHO} ${PHP_URL_PREFIX} | \ - ${SED} -e "s/\//\\\\\\\\\//g") -ALIB_XML_RPC_PREFIX_S=$(shell ${ECHO} ${ALIB_XML_RPC_PREFIX} | \ - ${SED} -e "s/\//\\\\\\\\\//g") -STORAGE_TMP_DIR_S=$(shell ${ECHO} ${STORAGE_TMP_DIR} | \ - ${SED} -e "s/\//\\\\\\\\\//g") -AUDIO_OUT_S=$(shell ${ECHO} ${AUDIO_OUT} | ${SED} -e "s/\//\\\\\\\\\//g") -AUDIO_CUE_S=$(shell ${ECHO} ${AUDIO_CUE} | ${SED} -e "s/\//\\\\\\\\\//g") -SCHEDULER_DAEMON_COMMAND_S=$(shell ${ECHO} ${SCHEDULER_DAEMON_COMMAND} | \ - ${SED} -e "s/\//\\\\\\\\\//g") - -REPLACE_SED_STRING="s/ls_var_dir/${USR_VAR_DIR_S}/; \ - s/ls_dbuser/${DB_USER}/; \ - s/ls_dbpassword/${DB_PASSWORD}/; \ - s/ls_dbserver/${DB_SERVER}/; \ - s/ls_database/${DATABASE}/; \ - s/ls_php_urlPrefix/${PHP_URL_PREFIX_S}/; \ - s/ls_php_host/${HOSTNAME}/; \ - s/ls_php_port/${WWW_PORT}/; \ - s/ls_alib_xmlRpcPrefix/${ALIB_XML_RPC_PREFIX_S}/; \ - s/ls_tmp_dir/${STORAGE_TMP_DIR_S}/; \ - s/ls_audio_output_device/${AUDIO_OUT_S}/; \ - s/ls_audio_cue_device/${AUDIO_CUE_S}/; \ - s/ls_scheduler_host/${HOSTNAME}/; \ - s/ls_scheduler_port/${SCHEDULER_PORT}/; \ - s/ls_scheduler_xmlRpcPrefix/${SCHEDULER_XML_RPC_PREFIX}/; \ - s/ls_scheduler_daemon_command/${SCHEDULER_DAEMON_COMMAND_S}/;" - -GENRB = @GENRB@ -TMP_STUDIO-LOCALIZATION_DIR = ${TMP_DIR}/studio-localization -GENRBOPTS = --destdir ${TMP_STUDIO-LOCALIZATION_DIR} \ - --encoding utf-8 \ - --strict - -VPATH = ${SRC_DIR} - -MODULES_DIR = ${BASE_DIR}/../../modules -PRODUCTS_DIR = ${BASE_DIR}/../../products - -STORAGE_SERVER_DIR = ${MODULES_DIR}/storageServer - -SCHEDULER_DIR = ${PRODUCTS_DIR}/scheduler -SCHEDULER_EXE = ${SCHEDULER_DIR}/tmp/campcaster-scheduler - -CORE_DIR = ${MODULES_DIR}/core -CORE_INCLUDE_DIR = ${CORE_DIR}/include -CORE_LIB_DIR = ${CORE_DIR}/lib -CORE_LIB = livesupport_core -CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a - -AUTHENTICATION_DIR = ${MODULES_DIR}/authentication -AUTHENTICATION_INCLUDE_DIR = ${AUTHENTICATION_DIR}/include -AUTHENTICATION_LIB_DIR = ${AUTHENTICATION_DIR}/lib -AUTHENTICATION_LIB = livesupport_authentication -AUTHENTICATION_LIB_FILE = ${AUTHENTICATION_LIB_DIR}/lib${AUTHENTICATION_LIB}.a - -STORAGE_CLIENT_DIR = ${MODULES_DIR}/storageClient -STORAGE_CLIENT_INCLUDE_DIR = ${STORAGE_CLIENT_DIR}/include -STORAGE_CLIENT_LIB_DIR = ${STORAGE_CLIENT_DIR}/lib -STORAGE_CLIENT_LIB = livesupport_storage_client -STORAGE_CLIENT_LIB_FILE = ${STORAGE_CLIENT_LIB_DIR}/lib${STORAGE_CLIENT_LIB}.a - -SCHEDULER_CLIENT_DIR = ${MODULES_DIR}/schedulerClient -SCHEDULER_CLIENT_INCLUDE_DIR = ${SCHEDULER_CLIENT_DIR}/include -SCHEDULER_CLIENT_LIB_DIR = ${SCHEDULER_CLIENT_DIR}/lib -SCHEDULER_CLIENT_LIB = livesupport_scheduler_client -SCHEDULER_CLIENT_LIB_FILE = ${SCHEDULER_CLIENT_LIB_DIR}/lib${SCHEDULER_CLIENT_LIB}.a - -PLAYLIST_EXECUTOR_DIR = ${MODULES_DIR}/playlistExecutor -PLAYLIST_EXECUTOR_INCLUDE_DIR = ${PLAYLIST_EXECUTOR_DIR}/include -PLAYLIST_EXECUTOR_LIB_DIR = ${PLAYLIST_EXECUTOR_DIR}/lib -PLAYLIST_EXECUTOR_LIB = livesupport_playlist_executor -PLAYLIST_EXECUTOR_LIB_FILE = ${PLAYLIST_EXECUTOR_LIB_DIR}/lib${PLAYLIST_EXECUTOR_LIB}.a - -WIDGETS_DIR = ${MODULES_DIR}/widgets -WIDGETS_INCLUDE_DIR = ${WIDGETS_DIR}/include -WIDGETS_LIB_DIR = ${WIDGETS_DIR}/lib -WIDGETS_LIB = livesupport_widgets -WIDGETS_LIB_FILE = ${WIDGETS_LIB_DIR}/lib${WIDGETS_LIB}.a - -BOOST_CFLAGS=@BOOST_CPPFLAGS@ -BOOST_LIBS=@BOOST_LDFLAGS@ -BOOST_DATE_TIME_LIB=@BOOST_DATE_TIME_LIB@ - -LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ -LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ - -CURL_CFLAGS=@CURL_CFLAGS@ -CURL_LIBS=@CURL_LIBS@ - -GTKMM_CFLAGS=@GTKMM_CFLAGS@ -GTKMM_LIBS=@GTKMM_LIBS@ - -LIBGLADEMM_CFLAGS=@LIBGLADEMM_CFLAGS@ -LIBGLADEMM_LIBS=@LIBGLADEMM_LIBS@ - -GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ -GSTREAMER_LIBS=@GSTREAMER_LIBS@ - -GSTCONTROLLER_CFLAGS=@GSTCONTROLLER_CFLAGS@ -GSTCONTROLLER_LIBS=@GSTCONTROLLER_LIBS@ - -LIBSERIAL_CFLAGS=@LIBSERIAL_CFLAGS@ -LIBSERIAL_LIBS=@LIBSERIAL_LIBS@ - -ICU_CFLAGS=@ICU_CFLAGS@ -ICU_CXXFLAGS=@ICU_CXXFLAGS@ -ICU_LIBS=@ICU_LIBS@ - -TAGLIB_CFLAGS=@TAGLIB_CFLAGS@ -TAGLIB_LIBS=@TAGLIB_LIBS@ - -TEST_RESULTS = ${DOC_DIR}/testResults.xml -# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR -TEST_XSLT = ../etc/testResultToHtml.xsl - -G_LIVESUPPORT_EXE = ${TMP_DIR}/campcaster-studio -G_LIVESUPPORT_SH = ${BIN_DIR}/campcaster-studio_devenv.sh -G_LIVESUPPORT_CFG = ${ETC_DIR}/campcaster-studio.xml -TEST_RUNNER = ${TMP_DIR}/testRunner - -DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config - -export LD_LIBRARY_PATH:=${USR_LIB_DIR}:${LD_LIBRARY_PATH} - - -#------------------------------------------------------------------------------- -# Configuration parameters -#------------------------------------------------------------------------------- -CPPFLAGS = @CPPFLAGS@ -CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ - -pedantic -Wall -Wno-long-long \ - ${BOOST_CFLAGS} \ - ${TAGLIB_CFLAGS} \ - ${LIBXMLPP_CFLAGS} \ - ${GTKMM_CFLAGS} \ - ${LIBGLADEMM_CFLAGS} \ - ${GSTREAMER_CFLAGS} \ - ${GSTCONTROLLER_CFLAGS} \ - ${LIBSERIAL_CFLAGS} \ - -I${USR_INCLUDE_DIR} \ - -I${CORE_INCLUDE_DIR} \ - -I${AUTHENTICATION_INCLUDE_DIR} \ - -I${STORAGE_CLIENT_INCLUDE_DIR} \ - -I${WIDGETS_INCLUDE_DIR} \ - -I${SCHEDULER_CLIENT_INCLUDE_DIR} \ - -I${PLAYLIST_EXECUTOR_INCLUDE_DIR} \ - -I${TMP_DIR} -LDFLAGS = @LDFLAGS@ -pthread \ - ${BOOST_LIBS} \ - ${ICU_LIBS} \ - ${LIBXMLPP_LIBS} \ - ${CURL_LIBS} \ - ${GTKMM_LIBS} \ - ${LIBGLADEMM_LIBS} \ - ${GSTREAMER_LIBS} \ - ${GSTCONTROLLER_LIBS} \ - ${LIBSERIAL_LIBS} \ - ${TAGLIB_LIBS} \ - -L${USR_LIB_DIR} \ - -L${CORE_LIB_DIR} \ - -L${AUTHENTICATION_LIB_DIR} \ - -L${STORAGE_CLIENT_LIB_DIR} \ - -L${WIDGETS_LIB_DIR} \ - -L${SCHEDULER_CLIENT_LIB_DIR} \ - -L${PLAYLIST_EXECUTOR_LIB_DIR} - - -#------------------------------------------------------------------------------- -# Dependencies -#------------------------------------------------------------------------------- -G_LIVESUPPORT_OBJS = ${TMP_DIR}/GLiveSupport.o \ - ${TMP_DIR}/MasterPanelWindow.o \ - ${TMP_DIR}/NowPlaying.o \ - ${TMP_DIR}/GuiObject.o \ - ${TMP_DIR}/GuiWindow.o \ - ${TMP_DIR}/GuiComponent.o \ - ${TMP_DIR}/LoginWindow.o \ - ${TMP_DIR}/UploadFileWindow.o \ - ${TMP_DIR}/ScratchpadWindow.o \ - ${TMP_DIR}/PlaylistWindow.o \ - ${TMP_DIR}/SchedulerWindow.o \ - ${TMP_DIR}/SchedulePlaylistWindow.o \ - ${TMP_DIR}/SearchWindow.o \ - ${TMP_DIR}/AdvancedSearchEntry.o \ - ${TMP_DIR}/AdvancedSearchItem.o \ - ${TMP_DIR}/BrowseEntry.o \ - ${TMP_DIR}/BrowseItem.o \ - ${TMP_DIR}/LiveModeWindow.o \ - ${TMP_DIR}/CuePlayer.o \ - ${TMP_DIR}/KeyboardShortcut.o \ - ${TMP_DIR}/KeyboardShortcutContainer.o \ - ${TMP_DIR}/KeyboardShortcutList.o \ - ${TMP_DIR}/OptionsWindow.o \ - ${TMP_DIR}/DateTimeChooserWindow.o \ - ${TMP_DIR}/BackupList.o \ - ${TMP_DIR}/BackupView.o \ - ${TMP_DIR}/ExportPlaylistWindow.o \ - ${TMP_DIR}/ExportFormatRadioButtons.o \ - ${TMP_DIR}/TransportList.o \ - ${TMP_DIR}/RestoreBackupWindow.o \ - ${TMP_DIR}/TaskbarIcons.o \ - ${TMP_DIR}/RdsView.o \ - ${TMP_DIR}/RdsEntry.o \ - ${TMP_DIR}/DndMethods.o - -G_LIVESUPPORT_RES = ${TMP_STUDIO-LOCALIZATION_DIR}/root.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/en.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/es.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/fr.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/hu.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/nl.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/pl.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/sr_CS.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/sr_CS_CYRILLIC.res \ - ${TMP_STUDIO-LOCALIZATION_DIR}/sv.res - -G_LIVESUPPORT_EXE_OBJS = ${TMP_DIR}/main.o - -FSDF = ${G_LIVESUPPORT_OBJS} \ - ${TMP_DIR}/main.o -G_LIVESUPPORT_EXE_LIBS = -l${PLAYLIST_EXECUTOR_LIB} \ - -l${AUTHENTICATION_LIB} \ - -l${STORAGE_CLIENT_LIB} \ - -l${WIDGETS_LIB} \ - -l${SCHEDULER_CLIENT_LIB} \ - -l${CORE_LIB} \ - ${BOOST_DATE_TIME_LIB} \ - -lxmlrpc++ -lssl -ltar - -TEST_RUNNER_OBJS = ${G_LIVESUPPORT_OBJS} \ - ${TMP_DIR}/TestRunner.o \ - ${TMP_DIR}/AudioPlayerTest.o \ - ${TMP_DIR}/GLiveSupportTest.o \ - ${TMP_DIR}/KeyboardShortcutTest.o - -TEST_RUNNER_LIBS = ${G_LIVESUPPORT_EXE_LIBS} -lcppunit -ldl - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -.PHONY: all dir_setup doc clean docclean depclean distclean check install -.PHONY: init start run_tests stop deinit - -all: dir_setup ${G_LIVESUPPORT_EXE} ${G_LIVESUPPORT_RES} - -dir_setup: ${TMP_DIR} ${TMP_STUDIO-LOCALIZATION_DIR} ${DOXYGEN_DIR} - -doc: - ${DOXYGEN} ${DOXYGEN_CONFIG} - -clean: - ${RM} ${G_LIVESUPPORT_EXE_OBJS} ${G_LIVESUPPORT_RES} ${G_LIVESUPPORT_EXE} - ${RMDIR} ${TMP_STUDIO-LOCALIZATION_DIR} - ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info - -docclean: - ${RMDIR} ${DOXYGEN_DIR}/html - ${RMDIR} ${COVERAGE_DIR}/* - ${RM} ${TEST_RESULTS} - -depclean: clean - ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} clean - ${MAKE} -C ${SCHEDULER_CLIENT_DIR} clean - ${MAKE} -C ${WIDGETS_DIR} clean - ${MAKE} -C ${STORAGE_CLIENT_DIR} clean - ${MAKE} -C ${AUTHENTICATION_DIR} clean - ${MAKE} -C ${CORE_DIR} clean - -distclean: clean docclean - ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te* ${TMP_DIR}/ac*.m4 - -check: all ${TEST_RUNNER} storage_server_init run_tests - -install: all - ${MAKE} -C ${CORE_DIR} install - ${MAKE} -C ${AUTHENTICATION_DIR} install - ${MAKE} -C ${STORAGE_CLIENT_DIR} install - ${MAKE} -C ${WIDGETS_DIR} install - ${MAKE} -C ${SCHEDULER_CLIENT_DIR} install - ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} install - ${MKDIR} ${USR_BIN_DIR} - ${CP} ${BIN_DIR}/campcaster-studio.sh ${USR_BIN_DIR} - ${CP} ${G_LIVESUPPORT_EXE} ${USR_BIN_DIR} - ${MKDIR} ${USR_ETC_DIR} - ${CP} ${ETC_DIR}/campcaster-studio.xml.template ${USR_ETC_DIR} - ${CAT} ${ETC_DIR}/campcaster-studio.xml.template | \ - ${SED} -e ${REPLACE_SED_STRING} \ - > ${USR_ETC_DIR}/campcaster-studio.xml - ${MKDIR} ${USR_VAR_DIR}/Campcaster - ${CP} ${VAR_DIR}/campcaster.png \ - ${VAR_DIR}/stationLogo.png \ - ${VAR_DIR}/icon*.png \ - ${VAR_DIR}/testAudio.ogg \ - ${USR_VAR_DIR}/Campcaster - ${MKDIR} ${USR_VAR_DIR}/Campcaster/studio-localization - ${CP} ${TMP_DIR}/studio-localization/*.res \ - ${USR_VAR_DIR}/Campcaster/studio-localization/ - ${MKDIR} ${USR_VAR_DIR}/Campcaster/glade - ${CP} ${VAR_DIR}/glade/*.glade \ - ${USR_VAR_DIR}/Campcaster/glade/ - -run_tests: ${TEST_RUNNER} - ${TEST_RUNNER} -o ${TEST_RESULTS} -s ${TEST_XSLT} - -run: all - ${G_LIVESUPPORT_SH} - -init: ${SCHEDULER_EXE} - -${MAKE} -C ${STORAGE_SERVER_DIR} db_init - -${MAKE} -C ${SCHEDULER_DIR} init - -start: ${SCHEDULER_EXE} - ${MAKE} -C ${SCHEDULER_DIR} start - -stop: ${SCHEDULER_EXE} - ${MAKE} -C ${SCHEDULER_DIR} stop - -status: ${SCHEDULER_EXE} - ${MAKE} -C ${SCHEDULER_DIR} status - -deinit: ${SCHEDULER_EXE} - -${MAKE} -C ${SCHEDULER_DIR} deinit - -${MAKE} -C ${STORAGE_SERVER_DIR} db_clean - -storage_server_init: - ${MAKE} -C ${STORAGE_SERVER_DIR} - - -#------------------------------------------------------------------------------- -# Specific targets -#------------------------------------------------------------------------------- -${G_LIVESUPPORT_EXE}: ${CORE_LIB_FILE} \ - ${AUTHENTICATION_LIB_FILE} \ - ${STORAGE_CLIENT_LIB_FILE} \ - ${WIDGETS_LIB_FILE} \ - ${SCHEDULER_CLIENT_LIB_FILE} \ - ${PLAYLIST_EXECUTOR_LIB_FILE} \ - ${G_LIVESUPPORT_OBJS} ${G_LIVESUPPORT_EXE_OBJS} - ${CXX} ${LDFLAGS} -o $@ $^ ${G_LIVESUPPORT_EXE_LIBS} - -${TMP_DIR}: - ${MKDIR} ${TMP_DIR} - -${TMP_STUDIO-LOCALIZATION_DIR}: - ${MKDIR} ${TMP_STUDIO-LOCALIZATION_DIR} - -${DOXYGEN_DIR}: - ${MKDIR} ${DOXYGEN_DIR} - -${TEST_RUNNER}: ${CORE_LIB_FILE} \ - ${AUTHENTICATION_LIB_FILE} \ - ${STORAGE_CLIENT_LIB_FILE} \ - ${WIDGETS_LIB_FILE} \ - ${SCHEDULER_CLIENT_LIB_FILE} \ - ${TEST_RUNNER_OBJS} - ${CXX} ${LDFLAGS} -o $@ ${TEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS} - -${CORE_LIB_FILE}: - ${MAKE} -C ${CORE_DIR} - -${AUTHENTICATION_LIB_FILE}: - ${MAKE} -C ${AUTHENTICATION_DIR} - -${STORAGE_CLIENT_LIB_FILE}: - ${MAKE} -C ${STORAGE_CLIENT_DIR} - -${WIDGETS_LIB_FILE}: - ${MAKE} -C ${WIDGETS_DIR} - -${SCHEDULER_CLIENT_LIB_FILE}: - ${MAKE} -C ${SCHEDULER_CLIENT_DIR} - -${PLAYLIST_EXECUTOR_LIB_FILE}: - ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} - - -#------------------------------------------------------------------------------- -# Pattern rules -#------------------------------------------------------------------------------- -${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx - ${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $< - -${TMP_STUDIO-LOCALIZATION_DIR}/%.res : ${VAR_DIR}/%.txt - ${GENRB} ${GENRBOPTS} $^ - diff --git a/src/products/gLiveSupport/etc/acinclude.m4 b/src/products/gLiveSupport/etc/acinclude.m4 deleted file mode 100644 index 20cd235ab..000000000 --- a/src/products/gLiveSupport/etc/acinclude.m4 +++ /dev/null @@ -1,575 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl Macro to check for available modules using pkg-conf -dnl -dnl usage: -dnl PKG_CHECK_MODULES(GSTUFF,[gtk+-2.0 >= 1.3], action-if, action-not) -dnl -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -dnl -dnl This function was taken from the glade-- project -dnl----------------------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for taglib of sufficient version by looking at taglib-config -dnl -dnl usage: -dnl AC_CHECK_TAGLIB(version, action-if, action-not) -dnl -dnl defines TAGLIB_LIBS, TAGLIB_CFLAGS, see taglib-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_TAGLIB], [ - succeeded=no - - if test -z "$TAGLIB_CONFIG"; then - AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, no) - fi - - if test "$TAGLIB_CONFIG" = "no" ; then - echo "*** The taglib-config script could not be found. Make sure it is" - echo "*** in your path, and that taglib is properly installed." - echo "*** Or see http://developer.kde.org/~wheeler/taglib.html" - else - TAGLIB_VERSION=`$TAGLIB_CONFIG --version` - AC_MSG_CHECKING(for taglib >= $1) - VERSION_CHECK=`expr $TAGLIB_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(TAGLIB_CFLAGS) - TAGLIB_CFLAGS=`$TAGLIB_CONFIG --cflags` - AC_MSG_RESULT($TAGLIB_CFLAGS) - - AC_MSG_CHECKING(TAGLIB_LIBS) - TAGLIB_LIBS=`$TAGLIB_CONFIG --libs` - AC_MSG_RESULT($TAGLIB_LIBS) - else - TAGLIB_CFLAGS="" - TAGLIB_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find taglib >= $1",) - fi - - AC_SUBST(TAGLIB_CFLAGS) - AC_SUBST(TAGLIB_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (taglib) not met.]), [$3]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for ICU of sufficient version by looking at icu-config -dnl -dnl usage: -dnl AC_CHECK_ICU(version, action-if, action-not) -dnl -dnl defines ICU_LIBS, ICU_CFLAGS, ICU_CXXFLAGS, see icu-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_ICU], [ - succeeded=no - - if test -z "$ICU_CONFIG"; then - AC_PATH_PROG(ICU_CONFIG, icu-config, no) - fi - - if test "$ICU_CONFIG" = "no" ; then - echo "*** The icu-config script could not be found. Make sure it is" - echo "*** in your path, and that taglib is properly installed." - echo "*** Or see http://ibm.com/software/globalization/icu/" - else - ICU_VERSION=`$ICU_CONFIG --version` - AC_MSG_CHECKING(for ICU >= $1) - VERSION_CHECK=`expr $ICU_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(ICU_CFLAGS) - ICU_CFLAGS=`$ICU_CONFIG --cflags` - AC_MSG_RESULT($ICU_CFLAGS) - - AC_MSG_CHECKING(ICU_CXXFLAGS) - ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags` - AC_MSG_RESULT($ICU_CXXFLAGS) - - AC_MSG_CHECKING(ICU_LIBS) - ICU_LIBS=`$ICU_CONFIG --ldflags` - AC_MSG_RESULT($ICU_LIBS) - else - ICU_CFLAGS="" - ICU_CXXFLAGS="" - ICU_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find ICU >= $1",) - fi - - AC_SUBST(ICU_CFLAGS) - AC_SUBST(ICU_CXXFLAGS) - AC_SUBST(ICU_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for curl of sufficient version by looking at curl-config -dnl -dnl usage: -dnl AC_CHECK_CURL(version, action-if, action-not) -dnl -dnl defines CURL_LIBS, CURL_CFLAGS, see curl-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_CURL], [ - succeeded=no - - if test -z "$CURL_CONFIG"; then - AC_PATH_PROG(CURL_CONFIG, curl-config, no) - fi - - if test "$CURL_CONFIG" = "no" ; then - echo "*** The curl-config script could not be found. Make sure it is" - echo "*** in your path, and that curl is properly installed." - echo "*** Or see http://curl.haxx.se/" - else - dnl curl-config --version returns "libcurl ", thus cut the number - CURL_VERSION=`$CURL_CONFIG --version | cut -d" " -f2` - AC_MSG_CHECKING(for curl >= $1) - VERSION_CHECK=`expr $CURL_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(CURL_CFLAGS) - CURL_CFLAGS=`$CURL_CONFIG --cflags` - AC_MSG_RESULT($CURL_CFLAGS) - - AC_MSG_CHECKING(CURL_LIBS) - CURL_LIBS=`$CURL_CONFIG --libs` - AC_MSG_RESULT($CURL_LIBS) - else - CURL_CFLAGS="" - CURL_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find curl >= $1",) - fi - - AC_SUBST(CURL_CFLAGS) - AC_SUBST(CURL_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (curl) not met.]), [$3]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for C++ namespaces -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ac_cxx_namespaces.html -dnl -dnl usage: -dnl If the compiler can prevent names clashes using namespaces, -dnl define HAVE_NAMESPACES. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CXX_NAMESPACES], -[AC_CACHE_CHECK(whether the compiler implements namespaces, -ac_cv_cxx_namespaces, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) -fi -]) - - -dnl----------------------------------------------------------------------------- -dnl Test for the Boost C++ libraries of a particular version (or newer). -dnl for more information on boost, see http://www.boost.org/ -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ax_boost_base.html -dnl -dnl usage: -dnl If no path to the installed boost library is given the macro searches -dnl under ${prefix}, /usr, /usr/local, and /opt, and evaluates the $BOOST_ROOT -dnl environment variable. Further documentation is available at -dnl http://randspringer.de/boost/index.html -dnl -dnl This macro calls: AC_SUBST(BOOST_CPPFLAGS) and AC_SUBST(BOOST_LDFLAGS) -dnl and sets: HAVE_BOOST -dnl -dnl Modified for Campcaster: -dnl * --with-boost default changed to Yes; -dnl * if the library is not found, it does not die, just prints "no", leaves -dnl HAVE_BOOST undefined, and sets the BOOST_CPPFLAGS and BOOST_LDFLAGS -dnl variables to ""; -dnl * ${prefix} is prepended to the search path. -dnl -dnl Author: Thomas Porschberg -dnl -dnl License: -dnl Copyright © 2006 Thomas Porschberg -dnl Copying and distribution of this file, with or without modification, -dnl are permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is Yes) - it is possible to specify the root directory for boost (optional)]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - BOOST_CPPFLAGS="-I$ac_boost_path/include" - else - for ac_boost_path_tmp in ${prefix} /usr /usr/local /opt ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - for ac_boost_path in /usr /usr/local /opt ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - BOOST_LDFLAGS="-L$best_path/lib" - - if test "x$BOOST_ROOT" != "x"; then - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - BOOST_CPPFLAGS="" - BOOST_LDFLAGS="" - AC_MSG_RESULT(no) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) - - -dnl----------------------------------------------------------------------------- -dnl Test for Date_Time library from the Boost C++ libraries. -dnl for more information on boost, see http://www.boost.org/ -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ax_boost_date_time.html -dnl -dnl usage: -dnl The macro requires a preceding call to AX_BOOST_BASE. -dnl Further documentation is available at -dnl . -dnl -dnl This macro calls: AC_SUBST(BOOST_DATE_TIME_LIB) -dnl and sets: HAVE_BOOST_DATE_TIME -dnl -dnl Modified for Campcaster: -dnl * --with-boost-date-time default changed to Yes. -dnl * added some more recognized suffixes to the library's name, incl. "-st". -dnl -dnl Authors: -dnl Thomas Porschberg -dnl Michael Tindal -dnl -dnl License: -dnl Copyright © 2006 Thomas Porschberg -dnl Copying and distribution of this file, with or without modification, -dnl are permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AX_BOOST_DATE_TIME], -[ - AC_ARG_WITH([boost-date-time], - AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@], - [use the Date_Time library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_date_time_lib="" - else - want_boost="yes" - ax_boost_user_date_time_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Date_Time library is available, - ax_cv_boost_date_time, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::gregorian; date d(2002,Jan,10); - return 0; - ]]), - ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_date_time" = "xyes"; then - AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) - BN=boost_date_time - if test "x$ax_boost_user_date_time_lib" = "x"; then - for ax_lib in $BN $BN-st $BN-mt $BN-mt-s $BN-s \ - $BN-$CC $BN-$CC-st $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-st lib$BN-mt lib$BN-mt-s lib$BN-s \ - lib$BN-$CC lib$BN-$CC-st lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-st $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], - [link_date_time="no"]) - done - else - for ax_lib in $ax_boost_user_date_time_lib $BN-$ax_boost_user_date_time_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], - [link_date_time="no"]) - done - - fi - if test "x$link_date_time" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) - diff --git a/src/products/gLiveSupport/etc/audioPlayer.xml b/src/products/gLiveSupport/etc/audioPlayer.xml deleted file mode 100644 index 71a8b33ca..000000000 --- a/src/products/gLiveSupport/etc/audioPlayer.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - -]> - - - diff --git a/src/products/gLiveSupport/etc/authenticationClient.xml b/src/products/gLiveSupport/etc/authenticationClient.xml deleted file mode 100644 index a63a04718..000000000 --- a/src/products/gLiveSupport/etc/authenticationClient.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -]> - - - - - diff --git a/src/products/gLiveSupport/etc/authenticationClient.xml.user-template b/src/products/gLiveSupport/etc/authenticationClient.xml.user-template deleted file mode 100644 index 1c453d095..000000000 --- a/src/products/gLiveSupport/etc/authenticationClient.xml.user-template +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -]> - - - - - diff --git a/src/products/gLiveSupport/etc/campcaster-studio.xml b/src/products/gLiveSupport/etc/campcaster-studio.xml deleted file mode 100644 index 70b651d3d..000000000 --- a/src/products/gLiveSupport/etc/campcaster-studio.xml +++ /dev/null @@ -1,451 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 3000 - - - - - - - mp3 - mpeg - ogg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/products/gLiveSupport/etc/campcaster-studio.xml.template b/src/products/gLiveSupport/etc/campcaster-studio.xml.template deleted file mode 100644 index 0b0bf483f..000000000 --- a/src/products/gLiveSupport/etc/campcaster-studio.xml.template +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 3000 - - - - - - - mp3 - mpeg - ogg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/products/gLiveSupport/etc/campcaster-studio.xml.user-template b/src/products/gLiveSupport/etc/campcaster-studio.xml.user-template deleted file mode 100644 index 4a062cc5d..000000000 --- a/src/products/gLiveSupport/etc/campcaster-studio.xml.user-template +++ /dev/null @@ -1,450 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - 3000 - - - - - - - mp3 - mpeg - ogg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/products/gLiveSupport/etc/configure.ac b/src/products/gLiveSupport/etc/configure.ac deleted file mode 100644 index 618638cfa..000000000 --- a/src/products/gLiveSupport/etc/configure.ac +++ /dev/null @@ -1,289 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(Campcaster-Studio, 0.0, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../src/main.cxx) - -AC_CONFIG_HEADERS(configure.h) -AC_PROG_CXX() - -AC_CHECK_HEADERS(sys/types.h unistd.h getopt.h signal.h sys/stat.h time.h) -AC_CHECK_HEADERS(stdio.h fcntl.h sys/time.h pwd.h) - - -dnl----------------------------------------------------------------------------- -dnl specify whether debug info should be compiled into the executable -dnl----------------------------------------------------------------------------- -AC_SUBST(CXXFLAGS) - -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [compile with debug info (no)]), - [], - [enable_debug=no]) - -if test "x${enable_debug}" = "xyes"; then - CXXFLAGS="-g -O0" - AC_DEFINE( YDEBUG, 1, [Debug is on] ) -else - CXXFLAGS="-O3" -fi - - -AC_MSG_RESULT([using compiler options: ${CXXFLAGS}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the pkg-config path -dnl----------------------------------------------------------------------------- -AC_ARG_WITH([pkg-config-path], - AC_HELP_STRING([--with-pkg-config-path], - [use the pkg-config path (prefix/lib/pkgconfig)]), - [PKG_CONFIG_PATH=${withval}], - [PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH]) - -AC_MSG_RESULT([using pkg-config path: ${PKG_CONFIG_PATH}]) - -export PKG_CONFIG_PATH - -export PATH=${prefix}/bin:${PATH} - - -AX_BOOST_BASE([1.33.1]) -if test "x${BOOST_CPPFLAGS}" != "x"; then - AX_BOOST_DATE_TIME - if test "x${BOOST_DATE_TIME_LIB}" = "x"; then - AC_MSG_ERROR([Boost date-time library not found]) - fi -else - AC_MSG_ERROR([Boost library >= 1.33.1 not found]) -fi - -PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.8.1]) -AC_SUBST(LIBXMLPP_CFLAGS) -AC_SUBST(LIBXMLPP_LIBS) - -PKG_CHECK_MODULES(GTKMM,[gtkmm-2.4 >= 2.5.5]) -AC_SUBST(GTKMM_CFLAGS) -AC_SUBST(GTKMM_LIBS) - -PKG_CHECK_MODULES(LIBGLADEMM,[libglademm-2.4 >= 2.6.2]) -AC_SUBST(LIBGLADEMM_CFLAGS) -AC_SUBST(LIBGLADEMM_LIBS) - -PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.10 >= 0.10]) -AC_SUBST(GSTREAMER_CFLAGS) -AC_SUBST(GSTREAMER_LIBS) - -PKG_CHECK_MODULES(GSTCONTROLLER,[gstreamer-controller-0.10 >= 0.10]) -AC_SUBST(GSTCONTROLLER_CFLAGS) -AC_SUBST(GSTCONTROLLER_LIBS) - -PKG_CHECK_MODULES(LIBSERIAL,[libserial >= 0.5.2]) -AC_SUBST(LIBSERIAL_CFLAGS) -AC_SUBST(LIBSERIAL_LIBS) - -AC_CHECK_CURL(7.12.3) -AC_SUBST(CURL_CFLAGS) -AC_SUBST(CURL_LIBS) - -AC_CHECK_TAGLIB(1.3.1) -AC_SUBST(TAGLIB_CFLAGS) -AC_SUBST(TAGLIB_LIBS) - -AC_CHECK_ICU(3.0) -AC_SUBST(ICU_CFLAGS) -AC_SUBST(ICU_CXXFLAGS) -AC_SUBST(ICU_LIBS) - -AC_PATH_PROG(GENRB, genrb) -AC_SUBST(GENRB) - - -dnl----------------------------------------------------------------------------- -dnl enable compilaton for code coverage data -dnl----------------------------------------------------------------------------- -AC_SUBST(COVERAGE_CXXFLAGS) - -AC_ARG_ENABLE( coverage, -[ --enable-coverage enable code coverage data generaton (no) ], - ENABLE_COVERAGE=${enableval}, ENABLE_COVERAGE="no" ) - -if test "x${ENABLE_COVERAGE}" == "xyes" ; then - COVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage" - AC_MSG_RESULT([compiling in code coverage mode]) -else - AC_MSG_RESULT([not compiling in code coverage mode]) -fi - - -dnl----------------------------------------------------------------------------- -dnl specify the FQDN -dnl----------------------------------------------------------------------------- -AC_SUBST(HOSTNAME) - -AC_ARG_WITH([hostname], - AC_HELP_STRING([--with-hostname], - [use the specified hostname (guess)]), - [HOSTNAME=${withval}], [HOSTNAME=`hostname -f`]) - -AC_MSG_RESULT([using hostname: ${HOSTNAME}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the web server port -dnl----------------------------------------------------------------------------- -AC_SUBST(WWW_PORT) - -AC_ARG_WITH([www-port], - AC_HELP_STRING([--with-www-port], - [use the specified www port (80)]), - [WWW_PORT=${withval}], [WWW_PORT=80]) - -AC_MSG_RESULT([using www port: ${WWW_PORT}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the scheduler server port -dnl----------------------------------------------------------------------------- -AC_SUBST(SCHEDULER_PORT) - -AC_ARG_WITH([scheduler-port], - AC_HELP_STRING([--with-scheduler-port], - [use the specified scheduler port (3344)]), - [SCHEDULER_PORT=${withval}], [SCHEDULER_PORT=3344]) - -AC_MSG_RESULT([using scheduler port: ${SCHEDULER_PORT}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the database server name -dnl----------------------------------------------------------------------------- -AC_SUBST(DB_SERVER) - -AC_ARG_WITH([database-server], - AC_HELP_STRING([--with-database-server], - [use the specified database server (localhost)]), - [DB_SERVER=${withval}], [DB_SERVER=localhost]) - -AC_MSG_RESULT([using database server: ${DB_SERVER}]) - - -dnl----------------------------------------------------------------------------- -dnl get the name of the Campcaster database -dnl----------------------------------------------------------------------------- -AC_SUBST(DATABASE) - -AC_ARG_WITH([database], - AC_HELP_STRING([--with-database], - [the name of the postgresql database to use (Campcaster)]), - [DATABASE=${withval}], [DATABASE=Campcaster]) - -AC_MSG_RESULT([using database: ${DATABASE}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the database server user -dnl----------------------------------------------------------------------------- -AC_SUBST(DB_USER) - -AC_ARG_WITH([database-user], - AC_HELP_STRING([--with-database-user], - [use the specified database server user (campcaster)]), - [DB_USER=${withval}], [DB_USER=campcaster]) - -AC_MSG_RESULT([using database server user: ${DB_USER}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the database server user password -dnl----------------------------------------------------------------------------- -AC_SUBST(DB_PASSWORD) - -AC_ARG_WITH([database-password], - AC_HELP_STRING([--with-database-password], - [use the specified database server user password (campcaster)]), - [DB_PASSWORD=${withval}], [DB_PASSWORD=campcaster]) - -AC_MSG_RESULT([using database server user password: ${DB_PASSWORD}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the audio output device -dnl----------------------------------------------------------------------------- -AC_SUBST(AUDIO_OUT) - -AC_ARG_WITH([audio-out], - AC_HELP_STRING([--with-audio-out], - [use the specified audio output device, either ALSA or OSS - (default)]), - [AUDIO_OUT=${withval}], [AUDIO_OUT=default]) - -AC_MSG_RESULT([using audio output device: ${AUDIO_OUT}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the audio cue device -dnl----------------------------------------------------------------------------- -AC_SUBST(AUDIO_CUE) - -AC_ARG_WITH([audio-cue], - AC_HELP_STRING([--with-audio-cue], - [use the specified audio cue device, either ALSA or OSS - (default)]), - [AUDIO_CUE=${withval}], [AUDIO_CUE=default]) - -AC_MSG_RESULT([using audio cue device: ${AUDIO_CUE}]) - - -dnl display status info on what libraries will get compiled - -AC_MSG_NOTICE( -[using the following configuration settings: - - hostname: ${HOSTNAME} - www port: ${WWW_PORT} - scheduler port: ${SCHEDULER_PORT} - database server: ${DB_SERVER} - database name: ${DATABASE} - database user: ${DB_USER} - database user password: ${DB_PASSWORD} - audio output device: ${AUDIO_OUT} - audio cue device: ${AUDIO_CUE} - -]) - - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() diff --git a/src/products/gLiveSupport/etc/doxygen.config b/src/products/gLiveSupport/etc/doxygen.config deleted file mode 100644 index 9c076c81e..000000000 --- a/src/products/gLiveSupport/etc/doxygen.config +++ /dev/null @@ -1,1140 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -# Doxyfile 1.3.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = Campcaster - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/doxygen - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = \ -../../doc/doxygen/xmlrpc++.tag=../../../../../usr/share/doc/xmlrpc++ - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = YES - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/src/products/gLiveSupport/etc/keyboardShortcut.xml b/src/products/gLiveSupport/etc/keyboardShortcut.xml deleted file mode 100644 index c00d346ee..000000000 --- a/src/products/gLiveSupport/etc/keyboardShortcut.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - -]> - - - - - - diff --git a/src/products/gLiveSupport/etc/storageClient.xml b/src/products/gLiveSupport/etc/storageClient.xml deleted file mode 100644 index 46534a9e4..000000000 --- a/src/products/gLiveSupport/etc/storageClient.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - -]> - - - - - diff --git a/src/products/gLiveSupport/etc/storageClient.xml.user-template b/src/products/gLiveSupport/etc/storageClient.xml.user-template deleted file mode 100644 index aeef10013..000000000 --- a/src/products/gLiveSupport/etc/storageClient.xml.user-template +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - -]> - - - - - diff --git a/src/products/gLiveSupport/etc/testResultToHtml.xsl b/src/products/gLiveSupport/etc/testResultToHtml.xsl deleted file mode 100644 index f9e893521..000000000 --- a/src/products/gLiveSupport/etc/testResultToHtml.xsl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - Campcaster unit test results - - -

Preface

-This document is part of the -Campcaster -project, Copyright © 2004 Media -Development Loan Fund, under the GNU -GPL. -
-This is an automatically generated document. -

Scope

-This document contains the generated unit test results for the -Campcaster project. -

Summary

- - - - - - - - - - - - - - - - - - -
Total number of tests:
Tests passed:
Tests failed:
Test errors:
-
-

Tests

- - - - - - - - - - - - - -
test nametest status
failedpassed
- - -
- -
- diff --git a/src/products/gLiveSupport/lib/.keepme b/src/products/gLiveSupport/lib/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/products/gLiveSupport/lib/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx b/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx deleted file mode 100644 index 7b3e91b8a..000000000 --- a/src/products/gLiveSupport/src/AdvancedSearchEntry.cxx +++ /dev/null @@ -1,162 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "AdvancedSearchEntry.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "advancedSearchEntry"; - -/*------------------------------------------------------------------------------ - * The maximum number of AdvancedSearchItem children. - *----------------------------------------------------------------------------*/ -const int maxChildren = 5; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -AdvancedSearchEntry :: AdvancedSearchEntry(GuiObject * parent) - throw () - : GuiComponent(parent, - bundleName) -{ - metadataTypes = gLiveSupport->getMetadataTypeContainer(); - - Gtk::Label * fileTypeLabel; - glade->get_widget("advancedFileTypeLabel1", fileTypeLabel); - fileTypeLabel->set_label(*getResourceUstring("fileTypeTextLabel")); - - glade->get_widget_derived("advancedFileTypeEntry1", fileTypeEntry); - fileTypeEntry->append_text(*getResourceUstring("allFileType")); - fileTypeEntry->append_text(*getResourceUstring("audioClipFileType")); - fileTypeEntry->append_text(*getResourceUstring("playlistFileType")); - fileTypeEntry->set_active(0); - - for (int i = 0; i < maxChildren; ++i) { - Ptr::Ref searchItem(new AdvancedSearchItem( - this, - i, - metadataTypes)); - children.push_back(searchItem); - } - - children.at(0)->signalAddNew().connect(sigc::mem_fun(*this, - &AdvancedSearchEntry::onAddNewCondition )); -} - - -/*------------------------------------------------------------------------------ - * Add a new search condition entrys item. - *----------------------------------------------------------------------------*/ -void -AdvancedSearchEntry :: onAddNewCondition(void) throw () -{ - bool foundAvailableChild = false; - Ptr::Ref child; - - for (int i = 1; i < maxChildren; ++i) { - child = children.at(i); - if (!child->is_visible()) { - foundAvailableChild = true; - break; - } - } - - if (foundAvailableChild) { - child->show(); - } -} - - -/*------------------------------------------------------------------------------ - * Return the current state of the search fields. - *----------------------------------------------------------------------------*/ -Ptr::Ref -AdvancedSearchEntry :: getSearchCriteria(void) throw () -{ - Glib::ustring fileType; - switch (fileTypeEntry->get_active_row_number()) { - case 0: fileType = "all"; - break; - case 1: fileType = "audioClip"; - break; - case 2: fileType = "playlist"; - break; - default: std::cerr << "impossible value in AdvancedSearchEntry::" - << "getSearchCriteria()" << std::endl; - break; - } - - Ptr::Ref criteria(new SearchCriteria(fileType)); - - for (int i = 0; i < maxChildren; ++i) { - Ptr::Ref child = children.at(i); - if (child->is_visible()) { - criteria->addCondition(child->getSearchCondition()); - } - } - - return criteria; -} - - -/*------------------------------------------------------------------------------ - * Connect a callback to the "enter key pressed" event. - *----------------------------------------------------------------------------*/ -void -AdvancedSearchEntry :: connectCallback(const sigc::slot & callback) - throw () -{ - for (int i = 0; i < maxChildren; ++i) { - Ptr::Ref child = children.at(i); - child->signal_activate().connect(callback); - } -} - diff --git a/src/products/gLiveSupport/src/AdvancedSearchEntry.h b/src/products/gLiveSupport/src/AdvancedSearchEntry.h deleted file mode 100644 index 5b77d5621..000000000 --- a/src/products/gLiveSupport/src/AdvancedSearchEntry.h +++ /dev/null @@ -1,139 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef AdvancedSearchEntry_h -#define AdvancedSearchEntry_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/MetadataTypeContainer.h" -#include "LiveSupport/Core/SearchCriteria.h" -#include "LiveSupport/Widgets/ComboBoxText.h" -#include "AdvancedSearchItem.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A sub-window with one or more search input fields in it. - */ -class AdvancedSearchEntry : public GuiComponent -{ - private: - - /** - * A container holding all known metadata types. - */ - Ptr::Ref metadataTypes; - - /** - * The combo box for selecting the file types to search for. - */ - ComboBoxText * fileTypeEntry; - - /** - * The AdvancedSearchItem children of the widget. - */ - std::vector::Ref> children; - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - */ - AdvancedSearchEntry(GuiObject * parent) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~AdvancedSearchEntry(void) throw () - { - } - - /** - * Add a new search condition entry item. - */ - void - onAddNewCondition(void) throw (); - - /** - * Return the current state of the search fields. - * - * @return a new LiveSupport::StorageClient::SearchCriteria instance, - * which contains the data entered by the user - */ - Ptr::Ref - getSearchCriteria(void) throw (); - - /** - * Connect a callback to the "enter key pressed" event. - * - * @param callback the function to execute when enter is pressed. - */ - void - connectCallback(const sigc::slot & callback) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // AdvancedSearchEntry_h - diff --git a/src/products/gLiveSupport/src/AdvancedSearchItem.cxx b/src/products/gLiveSupport/src/AdvancedSearchItem.cxx deleted file mode 100644 index c4f59e8fa..000000000 --- a/src/products/gLiveSupport/src/AdvancedSearchItem.cxx +++ /dev/null @@ -1,106 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "AdvancedSearchItem.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -AdvancedSearchItem :: AdvancedSearchItem( - GuiObject * parent, - int index, - Ptr::Ref metadataTypes) - throw () - : GuiComponent(parent) -{ - glade->get_widget(addIndex("advancedSearchItem", index), enclosingBox); - - Gtk::Label * searchByLabel; - glade->get_widget(addIndex("advancedSearchByLabel", index), searchByLabel); - searchByLabel->set_label(*getResourceUstring("searchByTextLabel")); - - glade->get_widget_derived(addIndex("advancedMetadataEntry", index), - metadataEntry); - metadataEntry->setContents(metadataTypes); - - glade->get_widget_derived(addIndex("advancedOperatorEntry", index), - operatorEntry); - operatorEntry->setContents(getBundle()); - - glade->get_widget(addIndex("advancedValueEntry", index), valueEntry); - - if (index == 0) { - glade->get_widget(addIndex("advancedPlusMinusButton", index), - plusButton); - plusButton->signal_clicked().connect(sigc::mem_fun(*this, - &AdvancedSearchItem::onPlusButtonClicked)); - } else { - glade->get_widget(addIndex("advancedPlusMinusButton", index), - closeButton); - closeButton->signal_clicked().connect(sigc::mem_fun(*this, - &AdvancedSearchItem::onCloseButtonClicked)); - } -} - - -/*------------------------------------------------------------------------------ - * Return the current state of the search fields. - *----------------------------------------------------------------------------*/ -Ptr::Ref -AdvancedSearchItem :: getSearchCondition(void) throw () -{ - Ptr::Ref metadataKey = metadataEntry->getActiveKey(); - Ptr::Ref operatorKey = operatorEntry->getActiveKey(); - std::string value = valueEntry->get_text(); - - Ptr::Ref - condition(new SearchCriteria::SearchConditionType(*metadataKey, - *operatorKey, - value)); - - return condition; -} - diff --git a/src/products/gLiveSupport/src/AdvancedSearchItem.h b/src/products/gLiveSupport/src/AdvancedSearchItem.h deleted file mode 100644 index d0a74bc10..000000000 --- a/src/products/gLiveSupport/src/AdvancedSearchItem.h +++ /dev/null @@ -1,225 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef AdvancedSearchItem_h -#define AdvancedSearchItem_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/NumericTools.h" -#include "LiveSupport/Core/MetadataTypeContainer.h" -#include "LiveSupport/Core/SearchCriteria.h" -#include "LiveSupport/Widgets/MetadataComboBoxText.h" -#include "LiveSupport/Widgets/OperatorComboBoxText.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A single search input field. - */ -class AdvancedSearchItem : public GuiComponent, - private NumericTools -{ - private: - - /** - * The enclosing box. - */ - Gtk::Box * enclosingBox; - - /** - * The metadata field. - */ - MetadataComboBoxText * metadataEntry; - - /** - * The operator field. - */ - OperatorComboBoxText * operatorEntry; - - /** - * The "search for this value" field. - */ - Gtk::Entry * valueEntry; - - /** - * The "add new search item" button. - */ - Gtk::Button * plusButton; - - /** - * The "remove this item" button. - */ - Gtk::Button * closeButton; - - /** - * A signal object emitted when the plus button is pressed. - */ - sigc::signal signalAddNewObject; - - /** - * Event handler for the Plus button getting clicked. - */ - void - onPlusButtonClicked() throw () - { - signalAddNew().emit(); - } - - /** - * Event handler for the Close button getting clicked. - */ - void - onCloseButtonClicked() throw () - { - hide(); - } - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - * @param index the position of this item in the list of - * advanced search items. - * @param metadataTypes container holding all known metadata types - */ - AdvancedSearchItem(GuiObject * parent, - int index, - Ptr::Ref metadataTypes) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~AdvancedSearchItem(void) throw () - { - } - - /** - * Return the current state of the search fields. - * - * @return a new LiveSupport::StorageClient::SearchCriteria instance, - * which contains the data entered by the user - */ - Ptr::Ref - getSearchCondition(void) throw (); - - /** - * The signal proxy for pressing enter in the entry field. - * - * @return the signal_activate() proxy of the EntryBin. - */ - Glib::SignalProxy0 - signal_activate(void) throw () - { - return valueEntry->signal_activate(); - } - - /** - * The signal proxy for pressing the add new condition button. - * - * @return a signal emitted when the Plus button is clicked. - */ - sigc::signal - signalAddNew(void) throw () - { - return signalAddNewObject; - } - - /** - * Is the widget visible? - * - * return true if visible, false if not. - */ - bool - is_visible(void) throw () - { - return enclosingBox->is_visible(); - } - - /** - * Show the widget. - */ - void - show(void) throw () - { - if (!enclosingBox->is_visible()) { - enclosingBox->show(); - } - } - - /** - * Hide the widget. - */ - void - hide(void) throw () - { - if (enclosingBox->is_visible()) { - enclosingBox->hide(); - } - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // AdvancedSearchItem_h - diff --git a/src/products/gLiveSupport/src/AudioPlayerTest.cxx b/src/products/gLiveSupport/src/AudioPlayerTest.cxx deleted file mode 100644 index a4434bc1f..000000000 --- a/src/products/gLiveSupport/src/AudioPlayerTest.cxx +++ /dev/null @@ -1,300 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/Core/AudioClip.h" -#include "LiveSupport/Core/Playlist.h" - -#include "AudioPlayerTest.h" - - -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::gLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(AudioPlayerTest); - -namespace { - -/** - * The name of the configuration file for the audio player. - */ -const std::string audioPlayerConfigFileName - = "etc/audioPlayer.xml"; - -/** - * The name of the configuration file for the local storage. - */ -const std::string storageClientConfigFileName - = "storageClient.xml"; - -/** - * The name of the configuration file for the authentication client. - */ -const std::string authenticationClientConfigFileName - = "authenticationClient.xml"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -AudioPlayerTest :: setUp(void) throw () -{ - try { - Ptr::Ref parser( - new xmlpp::DomParser(audioPlayerConfigFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - - Ptr::Ref audioPlayerFactory; - - audioPlayerFactory = AudioPlayerFactory::getInstance(); - audioPlayerFactory->configure(*root); - - // initialize the audio player configured by the factory - Ptr::Ref audioPlayer; - audioPlayer = audioPlayerFactory->getAudioPlayer(); - audioPlayer->initialize(); - - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in audio player configuration file: " - << e.what() << std::endl; - } catch (xmlpp::exception &e) { - std::cerr << "syntax error in audio player configuration file: " - << e.what() << std::endl; - } - - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - storageClientConfigFileName); - const xmlpp::Element * root = document->get_root_node(); - - Ptr::Ref storageClientFactory; - - storageClientFactory = StorageClientFactory::getInstance(); - storageClientFactory->configure(*root); - - // initialize the storage client configured by the factory - Ptr::Ref storage; - storage = storageClientFactory->getStorageClient(); - storage->reset(); - - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in storage client configuration file: " - << e.what() << std::endl; - } catch (xmlpp::exception &e) { - std::cerr << "syntax error in storage client configuration file: " - << e.what() << std::endl; - } - - try { - xmlpp::DomParser parser; - const xmlpp::Document * document = getConfigDocument(parser, - authenticationClientConfigFileName); - const xmlpp::Element * root = document->get_root_node(); - - Ptr::Ref authentClientFactory; - - authentClientFactory = AuthenticationClientFactory::getInstance(); - authentClientFactory->configure(*root); - - // log in using the authentication client - Ptr::Ref authent; - authent = authentClientFactory->getAuthenticationClient(); - sessionId = authent->login("root", "q"); - - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in authentication client " - "configuration file: " - << e.what() << std::endl; - } catch (xmlpp::exception &e) { - std::cerr << "syntax error in authentication client " - "configuration file: " - << e.what() << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -AudioPlayerTest :: tearDown(void) throw () -{ - // de-initialize the audio player configured by the factory - Ptr::Ref audioPlayerFactory; - audioPlayerFactory = AudioPlayerFactory::getInstance(); - Ptr::Ref audioPlayer; - audioPlayer = audioPlayerFactory->getAudioPlayer(); - audioPlayer->deInitialize(); - - // log out using the authentication client - Ptr::Ref authentClientFactory; - authentClientFactory = AuthenticationClientFactory::getInstance(); - Ptr::Ref authent; - authent = authentClientFactory->getAuthenticationClient(); - CPPUNIT_ASSERT_NO_THROW(authent->logout(sessionId)); -} - - -/*------------------------------------------------------------------------------ - * Test to see if the audio player engine can be started and stopped - *----------------------------------------------------------------------------*/ -void -AudioPlayerTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref audioPlayerFactory; - - audioPlayerFactory = AudioPlayerFactory::getInstance(); - CPPUNIT_ASSERT(audioPlayerFactory.get()); - - Ptr::Ref audioPlayer; - - audioPlayer = audioPlayerFactory->getAudioPlayer(); - CPPUNIT_ASSERT(audioPlayer.get()); - CPPUNIT_ASSERT(!audioPlayer->isPlaying()); -} - - -/*------------------------------------------------------------------------------ - * Play an audio clip from storage. - *----------------------------------------------------------------------------*/ -void -AudioPlayerTest :: playAudioClipTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref - audioPlayerFactory = AudioPlayerFactory::getInstance(); - Ptr::Ref - audioPlayer = audioPlayerFactory->getAudioPlayer(); - - Ptr::Ref - storageClientFactory = StorageClientFactory::getInstance(); - Ptr::Ref - storage = storageClientFactory->getStorageClient(); - - Ptr::Ref audioClipId(new UniqueId(0x10001)); - Ptr::Ref audioClip; - CPPUNIT_ASSERT_NO_THROW( - audioClip = storage->acquireAudioClip(sessionId, audioClipId) - ); - - CPPUNIT_ASSERT_NO_THROW( - audioPlayer->open(*audioClip->getUri()) - ); - - CPPUNIT_ASSERT(!audioPlayer->isPlaying()); - CPPUNIT_ASSERT_NO_THROW(audioPlayer->start()); - CPPUNIT_ASSERT(audioPlayer->isPlaying()); - - Ptr::Ref sleepT(new time_duration(microseconds(10))); - while (audioPlayer->isPlaying()) { - TimeConversion::sleep(sleepT); - } - CPPUNIT_ASSERT(!audioPlayer->isPlaying()); - - CPPUNIT_ASSERT_NO_THROW( - storage->releaseAudioClip(audioClip) - ); - audioPlayer->close(); -} - - -/*------------------------------------------------------------------------------ - * Play a playlist from storage. - *----------------------------------------------------------------------------*/ -void -AudioPlayerTest :: playPlaylistTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref - audioPlayerFactory = AudioPlayerFactory::getInstance(); - Ptr::Ref - audioPlayer = audioPlayerFactory->getAudioPlayer(); - - Ptr::Ref - storageClientFactory = StorageClientFactory::getInstance(); - Ptr::Ref - storage = storageClientFactory->getStorageClient(); - - Ptr::Ref audioClipId(new UniqueId(2)); - Ptr::Ref playlist; - CPPUNIT_ASSERT_NO_THROW( - playlist = storage->acquirePlaylist(sessionId, audioClipId) - ); - - CPPUNIT_ASSERT_NO_THROW( - audioPlayer->open(*playlist->getUri()) - ); - - CPPUNIT_ASSERT(!audioPlayer->isPlaying()); - CPPUNIT_ASSERT_NO_THROW(audioPlayer->start()); - CPPUNIT_ASSERT(audioPlayer->isPlaying()); - - Ptr::Ref sleepT(new time_duration(microseconds(10))); - while (audioPlayer->isPlaying()) { - TimeConversion::sleep(sleepT); - } - CPPUNIT_ASSERT(!audioPlayer->isPlaying()); - - CPPUNIT_ASSERT_NO_THROW( - storage->releasePlaylist(playlist) - ); - audioPlayer->close(); -} - diff --git a/src/products/gLiveSupport/src/AudioPlayerTest.h b/src/products/gLiveSupport/src/AudioPlayerTest.h deleted file mode 100644 index 9c35599a9..000000000 --- a/src/products/gLiveSupport/src/AudioPlayerTest.h +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef AudioPlayerTest_h -#define AudioPlayerTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Core/BaseTestMethod.h" - - -namespace LiveSupport { -namespace gLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Testing audio playback from the storage. - * - * @see AudioPlayerFactory - */ -class AudioPlayerTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(AudioPlayerTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(playAudioClipTest); - CPPUNIT_TEST(playPlaylistTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The session ID returned by the authentication client login. - */ - Ptr::Ref sessionId; - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Play an audio clip from storage. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - playAudioClipTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Play a playlist from storage. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - playPlaylistTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace gLiveSupport -} // namespace LiveSupport - -#endif // AudioPlayerTest_h - diff --git a/src/products/gLiveSupport/src/BackupList.cxx b/src/products/gLiveSupport/src/BackupList.cxx deleted file mode 100644 index 01e636139..000000000 --- a/src/products/gLiveSupport/src/BackupList.cxx +++ /dev/null @@ -1,392 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/TimeConversion.h" -#include "BackupList.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The localization key for the 'working' status. - *----------------------------------------------------------------------------*/ -const Glib::ustring workingStatusKey = "workingStatus"; - -/*------------------------------------------------------------------------------ - * The localization key for the 'success' status. - *----------------------------------------------------------------------------*/ -const Glib::ustring successStatusKey = "successStatus"; - -/*------------------------------------------------------------------------------ - * The localization key for the 'fault' status. - *----------------------------------------------------------------------------*/ -const Glib::ustring faultStatusKey = "faultStatus"; - -/*------------------------------------------------------------------------------ - * The name of the user preference for storing the list of backups - *----------------------------------------------------------------------------*/ -const Glib::ustring userPreferencesKeyName = "activeBackups"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -BackupList :: BackupList (GuiObject * parent) - throw () - : GuiComponent(parent) -{ - // create the tree view - treeModel = Gtk::ListStore::create(modelColumns); - glade->get_widget_derived("backupListTreeView1", treeView); - treeView->set_model(treeModel); - treeView->connectModelSignals(treeModel); - - // Add the TreeView's view columns: - treeView->appendColumn(*getResourceUstring("titleColumnLabel"), - modelColumns.titleColumn, 300); - treeView->appendColumn(*getResourceUstring("dateColumnLabel"), - modelColumns.dateColumn, 180); - treeView->appendColumn(*getResourceUstring("statusColumnLabel"), - modelColumns.statusDisplayColumn, 50); - - userPreferencesKey.reset(new const Glib::ustring(userPreferencesKeyName)); -} - - -/*------------------------------------------------------------------------------ - * Add a new item to the list. - *----------------------------------------------------------------------------*/ -void -BackupList :: add(Ptr::Ref title, - Ptr::Ref criteria) - throw (XmlRpcException) -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr::Ref token = storage->createBackupOpen(sessionId, - criteria); - - Gtk::TreeRow row = *treeModel->append(); - row[modelColumns.titleColumn] = *title; - row[modelColumns.dateColumn] = *TimeConversion::nowString(); - row[modelColumns.statusColumn] = workingStatusKey; - row[modelColumns.statusDisplayColumn] - = *getResourceUstring(workingStatusKey); - row[modelColumns.tokenColumn] = *token; -} - - -/*------------------------------------------------------------------------------ - * Add an item with an already existing token to the list. - *----------------------------------------------------------------------------*/ -void -BackupList :: add(const Glib::ustring & title, - const Glib::ustring & date, - const Glib::ustring & token) - throw (XmlRpcException) -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr::Ref url; - Ptr::Ref path; - Ptr::Ref errorMessage; - - AsyncState status = storage->createBackupCheck(token, - url, - path, - errorMessage); - - Gtk::TreeRow row = *treeModel->append(); - row[modelColumns.titleColumn] = title; - row[modelColumns.dateColumn] = date; - row[modelColumns.tokenColumn] = token; - setStatus(row, status, url, errorMessage); -} - - -/*------------------------------------------------------------------------------ - * Remove the currently selected item from the list. - *----------------------------------------------------------------------------*/ -void -BackupList :: removeSelected(void) throw (XmlRpcException) -{ - Glib::RefPtr selection = treeView->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (!iter) { - return; - } - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - storage->createBackupClose(iter->get_value(modelColumns.tokenColumn)); - - treeModel->erase(iter); -} - - -/*------------------------------------------------------------------------------ - * Get the title of the currently selected item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -BackupList :: getSelectedTitle(void) throw () -{ - Ptr::Ref title; - - Glib::RefPtr selection = treeView->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (iter) { - Gtk::TreeRow row = *iter; - title.reset(new Glib::ustring(row[modelColumns.titleColumn])); - } - - return title; -} - - -/*------------------------------------------------------------------------------ - * Get the URL of the currently selected item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -BackupList :: getSelectedUrl(void) throw (XmlRpcException) -{ - Ptr::Ref url; - - Glib::RefPtr selection = treeView->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (!iter) { - return url; - } - - if (iter->get_value(modelColumns.statusColumn) == workingStatusKey) { - update(iter); - } - - if (iter->get_value(modelColumns.statusColumn) == successStatusKey) { - url.reset(new Glib::ustring(iter->get_value(modelColumns.urlColumn))); - } - - return url; -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending backup. - *----------------------------------------------------------------------------*/ -bool -BackupList :: updateSelected(void) throw (XmlRpcException) -{ - Glib::RefPtr selection = treeView->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (!iter) { - return false; - } else { - return update(iter); - } -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending backup. - *----------------------------------------------------------------------------*/ -bool -BackupList :: update(void) throw (XmlRpcException) -{ - bool didSomething = false; - - for (Gtk::TreeIter it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - didSomething |= update(it); - } - - return didSomething; -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending backup. - *----------------------------------------------------------------------------*/ -bool -BackupList :: updateSilently(void) throw () -{ - bool didSomething = false; - - for (Gtk::TreeIter it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - try { - didSomething |= update(it); - } catch (XmlRpcException &e) { - } - } - - return didSomething; -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending backup. - *----------------------------------------------------------------------------*/ -bool -BackupList :: update(Gtk::TreeIter iter) throw (XmlRpcException) -{ - if (iter->get_value(modelColumns.statusColumn) != workingStatusKey) { - return false; - } - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - - Ptr::Ref url; - Ptr::Ref path; - Ptr::Ref errorMessage; - - AsyncState status = storage->createBackupCheck( - iter->get_value(modelColumns.tokenColumn), - url, - path, - errorMessage); - - return setStatus(iter, status, url, errorMessage); -} - - -/*------------------------------------------------------------------------------ - * Set the status of the row pointed to by an iterator. - *----------------------------------------------------------------------------*/ -bool -BackupList :: setStatus(Gtk::TreeIter iter, - AsyncState status, - Ptr::Ref url, - Ptr::Ref errorMessage) - throw () -{ - if (status == AsyncState::pendingState) { - return false; - - } else if (status == AsyncState::finishedState) { - iter->set_value(modelColumns.statusColumn, - successStatusKey); - iter->set_value(modelColumns.statusDisplayColumn, - *getResourceUstring(successStatusKey)); - iter->set_value(modelColumns.urlColumn, - *url); - return true; - - } else if (status == AsyncState::failedState) { - iter->set_value(modelColumns.statusColumn, - faultStatusKey); - iter->set_value(modelColumns.statusDisplayColumn, - *formatMessage(faultStatusKey, *errorMessage)); - return false; - - } else { - std::cerr << "Impossible status: '" << status - << "' in BackupList::setStatus()." << std::endl; - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Return the contents of the backup list. - *----------------------------------------------------------------------------*/ -Ptr::Ref -BackupList :: getContents(void) throw () -{ - std::ostringstream contentsStream; - Gtk::TreeModel::const_iterator it; - - for (it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - Gtk::TreeRow row = *it; - contentsStream << row[modelColumns.titleColumn] << '\n'; - contentsStream << row[modelColumns.dateColumn] << '\n'; - contentsStream << row[modelColumns.tokenColumn] << '\n'; - } - - Ptr::Ref contents(new Glib::ustring( - contentsStream.str() )); - return contents; -} - - -/*------------------------------------------------------------------------------ - * Restore the contents of the backup list. - *----------------------------------------------------------------------------*/ -void -BackupList :: setContents(Ptr::Ref contents) - throw () -{ - std::istringstream contentsStream(contents->raw()); - - treeModel->clear(); - while (!contentsStream.eof()) { - std::string title; - std::string date; - std::string token; - - std::getline(contentsStream, title); - if (contentsStream.fail()) { - break; - } - std::getline(contentsStream, date); - if (contentsStream.fail()) { - break; - } - std::getline(contentsStream, token); - if (contentsStream.fail()) { - break; - } - - try { - add(title, date, token); - - } catch (XmlRpcException &e) { - } - } -} - diff --git a/src/products/gLiveSupport/src/BackupList.h b/src/products/gLiveSupport/src/BackupList.h deleted file mode 100644 index cf4f44f64..000000000 --- a/src/products/gLiveSupport/src/BackupList.h +++ /dev/null @@ -1,348 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BackupList_h -#define BackupList_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The list of pending backups. - * - * This is a Gtk::VBox containing a TreeView with the following columns: - *
    - *
  • shown: - *
      - *
    • backup title
    • - *
    • backup date
    • - *
    • backup status (localized; contains the fault string, if any)
    • - *
  • - *
  • hidden: - *
      - *
    • token
    • - *
    • backup status (not localized: "working" / "success" / "fault")
    • - *
    • URL (if the status is "success")
    • - *
  • - *
- * - * The BackupList is contained in the BackupView. - * - */ -class BackupList : public GuiComponent, - public ContentsStorable -{ - private: - - /** - * The user preferences key. - */ - Ptr::Ref userPreferencesKey; - - /** - * Set the status of the row pointed to by an iterator. - * - * @param iter points to the row we want to set the status of. - * @param status the new status ("working", "success" or "fault"). - * @param url must be non-0 if the status is "success". - * @param errorMessage must be non-0 if the status is "fault". - * @return true if the status is "success", false otherwise. - */ - bool - setStatus(Gtk::TreeIter iter, - AsyncState status, - Ptr::Ref url, - Ptr::Ref errorMessage) - throw (); - - /** - * Add an item with an already existing token to the list. - * - * @param title the title of the backup. - * @param date the date of the backup. - * @param token the token for this backup. - * @exception XmlRpcException thrown by the storage client. - */ - void - add(const Glib::ustring & title, - const Glib::ustring & date, - const Glib::ustring & token) - throw (XmlRpcException); - - /** - * Query the storage server about the status of the given row. - * If its status is 'working', call createBackupCheck - * on it, and change its displayed status, if needed. - * - * @param iter points to the row to be updated. - * @return true if createBackupCheck was called, and it returned - * 'success'; false in all other cases. - * @exception XmlRpcException thrown by the storage client. - */ - bool - update(Gtk::TreeIter iter) throw (XmlRpcException); - - - protected: - - /** - * The columns model needed by ZebraTreeView. - * - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - /** - * The column for the title of the backup. - */ - Gtk::TreeModelColumn titleColumn; - - /** - * The column for the date of the backup. - */ - Gtk::TreeModelColumn dateColumn; - - /** - * The column for the status of the backup (not localized). - */ - Gtk::TreeModelColumn statusColumn; - - /** - * The column for the status of the backup (localized). - */ - Gtk::TreeModelColumn statusDisplayColumn; - - /** - * The column for the token corresponding to the backup. - */ - Gtk::TreeModelColumn tokenColumn; - - /** - * The column for the URL of the backup. - */ - Gtk::TreeModelColumn urlColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(titleColumn); - add(dateColumn); - add(statusColumn); - add(statusDisplayColumn); - add(tokenColumn); - add(urlColumn); - } - }; - - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * The tree model, as a GTK reference. - */ - Glib::RefPtr treeModel; - - /** - * The tree view. - */ - ZebraTreeView * treeView; - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - */ - BackupList(GuiObject * parent) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~BackupList(void) throw () - { - } - - /** - * Add a new item to the list. - * - * @param title the title of the backup. - * @param criteria the search criteria for the backup. - * @exception XmlRpcException thrown by the storage client. - */ - void - add(Ptr::Ref title, - Ptr::Ref criteria) - throw (XmlRpcException); - - /** - * Remove the currently selected item from the list. - * The createBackupClose storage function is called on the backup task, - * and it is removed from the tree model. - * - * @exception XmlRpcException thrown by the storage client. - */ - void - removeSelected(void) throw (XmlRpcException); - - /** - * Get the title of the currently selected item. - * If no item is selected, then a 0 pointer is returned. - */ - Ptr::Ref - getSelectedTitle(void) throw (); - - /** - * Get the URL of the currently selected item. - * If the status of the item is 'working', then an update() is - * done first. - * If no item is selected, or the URL for the backup is not available - * yet, then a 0 pointer is returned. - * - * @exception XmlRpcException can be thrown by update(). - */ - Ptr::Ref - getSelectedUrl(void) throw (XmlRpcException); - - /** - * Query the storage server about the status of the selected row. - * If its status is 'working', call createBackupCheck - * on it, and change its displayed status, if needed. - * - * @return true if createBackupCheck was called, and it returned - * 'success'; false in all other cases. - * @exception XmlRpcException thrown by the storage client. - */ - bool - updateSelected(void) throw (XmlRpcException); - - /** - * Query the storage server about the status of the pending backup. - * If there is a backup with status 'working', call createBackupCheck - * on it, and change its displayed status, if needed. - * - * @return true if createBackupCheck was called, and it returned - * 'success'; false in all other cases. - * @exception XmlRpcException thrown by the storage client. - */ - bool - update(void) throw (XmlRpcException); - - /** - * Query the storage server about the status of the pending backup. - * If there is a backup with status 'working', call createBackupCheck - * on it, and change its displayed status, if needed. - * This is the same as update(), except it does not throw any - * exceptions (just ignores them). - * - * @return true if createBackupCheck was called, and it returned - * 'success'; false in all other cases. - */ - bool - updateSilently(void) throw (); - - /** - * Return the contents of the backup list. - * The format is a space-separated list of backup titles, dates - * and tokens. E.g.: "title1 date1 token1 title2 date2 token2". - * - * @return the contents of the backup list as a string. - */ - Ptr::Ref - getContents(void) throw (); - - /** - * Restore the contents of the backup list. - * The current contents are discarded, and replaced with the items - * listed in the 'contents' parameter. - * The format is a space-separated list of backup titles, dates - * and tokens. E.g.: "title1 date1 token1 title2 date2 token2". - * - * @param contents the new contents of the backup list as a string. - */ - void - setContents(Ptr::Ref contents) throw (); - - /** - * Return the user preferences key. - * The contents of the window will be stored in the user preferences - * under this key. - * - * @return the user preference key. - */ - Ptr::Ref - getUserPreferencesKey(void) throw () - { - return userPreferencesKey; - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // BackupList_h - diff --git a/src/products/gLiveSupport/src/BackupView.cxx b/src/products/gLiveSupport/src/BackupView.cxx deleted file mode 100644 index 36aaeafcf..000000000 --- a/src/products/gLiveSupport/src/BackupView.cxx +++ /dev/null @@ -1,291 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_PWD_H -#include -#else -#error need pwd.h -#endif - -#include "LiveSupport/Core/FileTools.h" - -#include "BackupView.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; -using namespace boost::posix_time; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "backupView"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -BackupView :: BackupView (GuiObject * parent) - throw () - : GuiComponent(parent, - bundleName) -{ - Gtk::Label * backupTitleLabel; - Gtk::Label * mtimeLabel; - Gtk::Button * chooseTimeButton; - Gtk::Button * resetTimeButton; - glade->get_widget("backupTitleLabel1", backupTitleLabel); - glade->get_widget("backupMtimeLabel1", mtimeLabel); - glade->get_widget("backupMtimeChooseButton1", chooseTimeButton); - glade->get_widget("backupMtimeResetButton1", resetTimeButton); - backupTitleLabel->set_label(*getResourceUstring("backupTitleLabel")); - mtimeLabel->set_label(*getResourceUstring("mtimeTextLabel")); - chooseTimeButton->set_label(*getResourceUstring("chooseTimeButtonLabel")); - resetTimeButton->set_label(*getResourceUstring("resetTimeButtonLabel")); - - chooseTimeButton->signal_clicked().connect(sigc::mem_fun(*this, - &BackupView::onChooseTimeButtonClicked)); - resetTimeButton->signal_clicked().connect(sigc::mem_fun(*this, - &BackupView::onResetTimeButtonClicked)); - - glade->get_widget("backupTitleEntry1", backupTitleEntry); - glade->get_widget("backupMtimeEntry1", mtimeEntry); - - writeMtimeEntry(); - - constructCriteriaView(); - constructBackupListView(); - - dateTimeChooserWindow.reset(new DateTimeChooserWindow()); -} - - -/*------------------------------------------------------------------------------ - * Construct the box for entering the backup criteria. - *----------------------------------------------------------------------------*/ -void -BackupView :: constructCriteriaView(void) throw () -{ - criteriaEntry.reset(new AdvancedSearchEntry(this)); - criteriaEntry->connectCallback(sigc::mem_fun(*this, - &BackupView::onCreateBackup)); - - Gtk::Button * backupButton; - glade->get_widget("backupButton1", backupButton); - backupButton->set_label(*getResourceUstring("backupButtonLabel")); - backupButton->signal_clicked().connect(sigc::mem_fun(*this, - &BackupView::onCreateBackup)); -} - - -/*------------------------------------------------------------------------------ - * Construct the box for listing the pending backups. - *----------------------------------------------------------------------------*/ -void -BackupView :: constructBackupListView(void) throw () -{ - backupList.reset(new BackupList(this)); - - glade->connect_clicked("backupDeleteButton1", sigc::mem_fun(*this, - &BackupView::onDeleteButtonClicked)); - glade->connect_clicked("backupSaveButton1", sigc::mem_fun(*this, - &BackupView::onSaveButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the time chooser button being clicked. - *----------------------------------------------------------------------------*/ -void -BackupView :: onChooseTimeButtonClicked(void) throw () -{ - Ptr::Ref userMtime = dateTimeChooserWindow->run(); - - if (userMtime && *userMtime != not_a_date_time) { - mtime = userMtime; - writeMtimeEntry(); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the "reset time" button being clicked. - *----------------------------------------------------------------------------*/ -void -BackupView :: onResetTimeButtonClicked(void) throw () -{ - mtime.reset(); - writeMtimeEntry(); -} - - -/*------------------------------------------------------------------------------ - * Initiate the creation of a new backup. - *----------------------------------------------------------------------------*/ -void -BackupView :: onCreateBackup(void) throw () -{ - Ptr::Ref title = readTitle(); - Ptr::Ref criteria = criteriaEntry->getSearchCriteria(); - - if (mtime) { - criteria->addMtimeCondition(">=", mtime); - } - - try { - backupList->add(title, criteria); - - } catch (XmlRpcException &e) { - Ptr::Ref errorMsg - = getResourceUstring("backupErrorMsg"); - errorMsg->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Delete button being clicked. - *----------------------------------------------------------------------------*/ -void -BackupView :: onDeleteButtonClicked(void) throw () -{ - try { - backupList->removeSelected(); - - } catch (XmlRpcException &e) { - Ptr::Ref errorMsg - = getResourceUstring("backupErrorMsg"); - errorMsg->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Save button being clicked. - *----------------------------------------------------------------------------*/ -void -BackupView :: onSaveButtonClicked(void) throw () -{ - Ptr::Ref url; - try { - url = backupList->getSelectedUrl(); - - } catch (XmlRpcException &e) { - Ptr::Ref errorMsg - = getResourceUstring("backupErrorMsg"); - errorMsg->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMsg); - } - - if (!url) { - return; - } - - Ptr::Ref dialog; - try { - dialog.reset(new Gtk::FileChooserDialog( - *getResourceUstring("fileChooserDialogTitle"), - Gtk::FILE_CHOOSER_ACTION_SAVE)); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - std::exit(1); - } - - struct passwd * pwd = getpwuid(getuid()); - if (pwd) { - dialog->set_current_folder(pwd->pw_dir); - } - - Ptr::Ref fileName = backupList->getSelectedTitle(); - fileName->append(".tar"); - dialog->set_current_name(*fileName); - - dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog->add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); - - int result = dialog->run(); - - if (result != Gtk::RESPONSE_OK) { - return; - } - - fileName->assign(dialog->get_filename()); - try { - FileTools::copyUrlToFile(*url, *fileName); - - } catch (std::runtime_error &e) { - // TODO: handle error - } -} - - -/*------------------------------------------------------------------------------ - * Read the title of the backup from the entry field. - *----------------------------------------------------------------------------*/ -Ptr::Ref -BackupView :: readTitle(void) throw () -{ - Ptr::Ref title(new Glib::ustring( - backupTitleEntry->get_text() )); - if (*title == "") { - title = getResourceUstring("defaultBackupTitle"); - } - - return title; -} - - -/*------------------------------------------------------------------------------ - * Format and write the contents of mtime into the mtimeEntry. - *----------------------------------------------------------------------------*/ -void -BackupView :: writeMtimeEntry(void) throw () -{ - if (mtime) { - mtimeEntry->set_text(to_simple_string(*mtime)); - } else { - mtimeEntry->set_text("-"); - } -} - diff --git a/src/products/gLiveSupport/src/BackupView.h b/src/products/gLiveSupport/src/BackupView.h deleted file mode 100644 index fc24d4b38..000000000 --- a/src/products/gLiveSupport/src/BackupView.h +++ /dev/null @@ -1,220 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BackupView_h -#define BackupView_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/TimeConversion.h" -#include "DateTimeChooserWindow.h" -#include "AdvancedSearchEntry.h" -#include "BackupList.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; -using namespace boost::posix_time; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The backup view, a subclass of Gtk::VBox. - * This will be contained in another window, most likely - * as the contents of a notebook tab. - * - * The layout of the view is roughly the following: - *

- *  +--- backup view -------------------+
- *  | +-- criteria selector pane -----+ |
- *  | +-- [[ AdvancedSearchEntry ]] --+ |
- *  | +-------------------(Backup)----+ |
- *  | +===============================+ |
- *  | +-- pending backups pane -------+ |
- *  | +-- [[ BackupList ]] -----------+ |
- *  | +---------------(Delete)-(Save)-+ |
- *  +-------------------------(Close)---+
- *  
- * - */ -class BackupView : public GuiComponent -{ - private: - - /** - * The text entry field for entering the title of the backup. - */ - Gtk::Entry * backupTitleEntry; - - /** - * The "modified since" time for the backup. - */ - Ptr::Ref mtime; - - /** - * The entry field holding the "modified since" time for the backup. - */ - Gtk::Entry * mtimeEntry; - - /** - * The window for entering the "modified since" time. - */ - Ptr::Ref dateTimeChooserWindow; - - /** - * The object for entering the backup criteria. - */ - Ptr::Ref criteriaEntry; - - /** - * The list of pending backups. - */ - Ptr::Ref backupList; - - /** - * Construct the box for entering the backup criteria. - * - * @return the constructed box, already Gtk::manage()'ed. - */ - void - constructCriteriaView(void) throw (); - - /** - * Construct the box for listing the pending backups. - * - * @return the constructed box, already Gtk::manage()'ed. - */ - void - constructBackupListView(void) throw (); - - /** - * Read the title of the backup from the entry field. - * If the entry is blank, a default title is used. - * - * @return the title. - */ - Ptr::Ref - readTitle(void) throw (); - - /** - * Format and write the contents of mtime into the mtimeEntry. - */ - void - writeMtimeEntry(void) throw (); - - - protected: - - /** - * Event handler for the time chooser button being clicked. - */ - void - onChooseTimeButtonClicked(void) throw (); - - /** - * Event handler for the "reset time" button being clicked. - */ - void - onResetTimeButtonClicked(void) throw (); - - /** - * Initiate the creation of a new backup. - */ - void - onCreateBackup(void) throw (); - - /** - * Event handler for the Delete button being clicked. - */ - void - onDeleteButtonClicked(void) throw (); - - /** - * Event handler for the Save button being clicked. - */ - void - onSaveButtonClicked(void) throw (); - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - */ - BackupView(GuiObject * parent) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~BackupView(void) throw () - { - } - - /** - * Return the BackupList object shown by the widget. - */ - Ptr::Ref - getBackupList(void) throw () - { - return backupList; - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // BackupView_h - diff --git a/src/products/gLiveSupport/src/BrowseEntry.cxx b/src/products/gLiveSupport/src/BrowseEntry.cxx deleted file mode 100644 index 3a532879d..000000000 --- a/src/products/gLiveSupport/src/BrowseEntry.cxx +++ /dev/null @@ -1,76 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "BrowseEntry.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -BrowseEntry :: BrowseEntry(GuiObject * parent) - throw () - : GuiComponent(parent) -{ - browseItemOne.reset(new BrowseItem(this, - 0, - 4 /* Genre */)); - browseItemTwo.reset(new BrowseItem(this, - 1, - 1 /* Creator */)); - browseItemThree.reset(new BrowseItem(this, - 2, - 2 /* Album */)); - // TODO: change hard-coded indices to stuff read from config - - browseItemOne->signalChanged().connect( - sigc::bind::Ref>( - sigc::mem_fun(*browseItemTwo, &BrowseItem::onParentChangedShow), - browseItemOne )); - browseItemTwo->signalChanged().connect( - sigc::bind::Ref>( - sigc::mem_fun(*browseItemThree, &BrowseItem::onParentChangedShow), - browseItemTwo )); -} - diff --git a/src/products/gLiveSupport/src/BrowseEntry.h b/src/products/gLiveSupport/src/BrowseEntry.h deleted file mode 100644 index 4aac66b53..000000000 --- a/src/products/gLiveSupport/src/BrowseEntry.h +++ /dev/null @@ -1,142 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BrowseEntry_h -#define BrowseEntry_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SearchCriteria.h" -#include "BrowseItem.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A Gtk::HBox with one or more search input fields in it. - * - */ -class BrowseEntry : public GuiComponent -{ - private: - - /** - * Default constructor. - */ - BrowseEntry(void) throw (); - - /** - * The first BrowseItem entry field. - */ - Ptr::Ref browseItemOne; - - /** - * The second BrowseItem entry field. - */ - Ptr::Ref browseItemTwo; - - /** - * The third BrowseItem entry field. - */ - Ptr::Ref browseItemThree; - - - public: - - /** - * Constructor with localization parameter. - * - * @param parent the GuiObject which contains this one. - */ - BrowseEntry(GuiObject * parent) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~BrowseEntry(void) throw () - { - } - - /** - * Return the current state of the search fields. - * - * @return a new LiveSupport::StorageClient::SearchCriteria instance, - * which contains the data entered by the user - */ - Ptr::Ref - getSearchCriteria(void) throw () - { - return browseItemThree->getSearchCriteria(); - } - - - /** - * The signal raised when either the combo box or the tree view - * selection has changed. - * - * @return the signalChanged() of the last browse item - */ - sigc::signal - signalChanged(void) throw () - { - return browseItemThree->signalChanged(); - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // BrowseEntry_h - diff --git a/src/products/gLiveSupport/src/BrowseItem.cxx b/src/products/gLiveSupport/src/BrowseItem.cxx deleted file mode 100644 index 0024039d6..000000000 --- a/src/products/gLiveSupport/src/BrowseItem.cxx +++ /dev/null @@ -1,157 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "BrowseItem.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -BrowseItem :: BrowseItem(GuiObject * parent, - int index, - int defaultIndex) - throw () - : GuiComponent(parent) -{ - parentCriteria.reset(new SearchCriteria); - - glade->get_widget_derived(addIndex("browseMetadataEntry", index), - metadataEntry); - metadataEntry->setContents(gLiveSupport->getMetadataTypeContainer()); - metadataEntry->set_active(defaultIndex); - metadataEntry->signal_changed().connect(sigc::mem_fun(*this, - &BrowseItem::onShow )); - - treeModel = Gtk::ListStore::create(modelColumns); - - glade->get_widget_derived(addIndex("browseMetadataValues", index), - metadataValues); - metadataValues->set_model(treeModel); - metadataValues->connectModelSignals(treeModel); - metadataValues->appendColumn("", modelColumns.displayedColumn, 200); - metadataValues->signal_cursor_changed().connect(sigc::mem_fun(*this, - &BrowseItem::emitSignalChanged )); - - allString = Glib::Markup::escape_text( - *getResourceUstring("allStringForBrowse")); - - onShow(); -} - - -/*------------------------------------------------------------------------------ - * Return the search criteria selected by the user. - *----------------------------------------------------------------------------*/ -Ptr::Ref -BrowseItem :: getSearchCriteria(void) throw (std::invalid_argument) -{ - Ptr::Ref metadataKey = metadataEntry->getActiveKey(); - - Glib::ustring metadataValue; - Glib::RefPtr refSelection = - metadataValues->get_selection(); - bool found = false; - if (refSelection) { - Gtk::TreeModel::iterator iter = refSelection->get_selected(); - if (iter) { - found = true; - metadataValue = (*iter)[modelColumns.originalColumn]; - } - } - - if (!found) { - return parentCriteria; // should never happen, but für alle Fälle - } - - if (metadataValue == allString) { - return parentCriteria; - - } else { - Ptr::Ref criteria(new SearchCriteria(*parentCriteria)); - criteria->addCondition(*metadataKey, "=", metadataValue); - return criteria; - } -} - - -/*------------------------------------------------------------------------------ - * Fill in the column with the possible values. - *----------------------------------------------------------------------------*/ -void -BrowseItem :: onShow(void) throw () -{ - Ptr::Ref metadataKey = metadataEntry->getActiveKey(); - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr >::Ref values; - try { - values = storage->browse(sessionId, metadataKey, parentCriteria); - } catch (XmlRpcException &e) { - std::cerr << "Error in BrowseItem::onShow(): " - << e.what() << std::endl; - return; - } - - treeModel->clear(); - Gtk::TreeModel::Row row = *treeModel->append(); - row[modelColumns.originalColumn] = allString; - row[modelColumns.displayedColumn] = allString; - metadataValues->get_selection()->select(*row); - - std::vector::const_iterator valuesIt; - for (valuesIt = values->begin(); valuesIt != values->end(); ++valuesIt) { - row = *treeModel->append(); - row[modelColumns.originalColumn] = *valuesIt; - row[modelColumns.displayedColumn] = Glib::Markup::escape_text( - *valuesIt); - } - - emitSignalChanged(); -} - diff --git a/src/products/gLiveSupport/src/BrowseItem.h b/src/products/gLiveSupport/src/BrowseItem.h deleted file mode 100644 index a4ccb735a..000000000 --- a/src/products/gLiveSupport/src/BrowseItem.h +++ /dev/null @@ -1,252 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BrowseItem_h -#define BrowseItem_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/NumericTools.h" -#include "LiveSupport/Core/SearchCriteria.h" -#include "LiveSupport/Widgets/MetadataComboBoxText.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A single browse input field. - * - * It consists of a Widgets::ComboBoxText and a Widgets::ZebraTreeView - * (without headers). It stores a "parent search criteria", and shows all - * possible metadata values of the type selected in the ComboBoxText which - * match this condition. The parent search criteria should be the conjunction - * of all search conditions selected in BrowseItem objects to the left of - * this one. - * - */ -class BrowseItem : public GuiComponent, - private NumericTools -{ - private: - - /** - * The type for storing both the metadata and the comparison operator - * localizations. - */ - typedef std::vector > - MapVector; - - /** - * The metadata field. - */ - MetadataComboBoxText * metadataEntry; - - /** - * The selection field. - */ - ZebraTreeView * metadataValues; - - /** - * The columns model needed by Gtk::TreeView. - * Lists one clip per row. - * - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - /** - * The original (unescaped) value of metadata. - */ - Gtk::TreeModelColumn originalColumn; - - /** - * The single displayed column. - */ - Gtk::TreeModelColumn displayedColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(originalColumn); - add(displayedColumn); - } - }; - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * The tree model, as a GTK reference. - */ - Glib::RefPtr treeModel; - - /** - * The localized version of the "--- all ---" string. - */ - Glib::ustring allString; - - /** - * The criteria from the browse items to the left of this one. - */ - Ptr::Ref parentCriteria; - - /** - * Default constructor. - */ - BrowseItem(void) throw (); - - /** - * Emit the "selection changed" signal. - */ - void - emitSignalChanged(void) throw () - { - signalChanged().emit(); - } - - - protected: - - /** - * A signal object to notify people that the selection has changed. - */ - sigc::signal signalChangedObject; - - - public: - - /** - * Constructor with parent and localization parameter. - * - * @param parent the GuiObject which contains this one. - * @param index the position of this item in the list of - * browse items. - * @param defaultIndex the index of the metadata entry to display - * initially - */ - BrowseItem(GuiObject * parent, - int index, - int defaultIndex) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~BrowseItem(void) throw () - { - } - - /** - * Return the search criteria selected by the user. - * This is the parent criteria (assumed to have operator "and") - * with the search condition showing the current selection added - * (if any). - * - * @return a new LiveSupport::StorageClient::SearchCriteria instance, - * which contains the data entered by the user - */ - Ptr::Ref - getSearchCriteria(void) throw (std::invalid_argument); - - /** - * Fill in the column with the possible values (limited by the - * parent criteria), and set the selection to "all". - */ - void - onShow(void) throw (); - - /** - * The signal handler for refreshing the treeview of metadata values, - * if we also need to change the parent criteria. Same as onShow(), - * plus changing the parent criteria. - * - * @param leftNeighbor the neighbor where the parent criteria - * are coming from. - */ - void - onParentChangedShow(Ptr::Ref leftNeighbor) - throw () - { - parentCriteria = leftNeighbor->getSearchCriteria(); - onShow(); - } - - /** - * The signal raised when either the combo box or the tree view - * selection has changed. - * - * @return the signal object (a protected member of this class) - */ - sigc::signal - signalChanged(void) throw () - { - return signalChangedObject; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // BrowseItem_h - diff --git a/src/products/gLiveSupport/src/ContentsStorable.h b/src/products/gLiveSupport/src/ContentsStorable.h deleted file mode 100644 index 648552633..000000000 --- a/src/products/gLiveSupport/src/ContentsStorable.h +++ /dev/null @@ -1,108 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ContentsStorable_h -#define ContentsStorable_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#include -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A virtual class to be implemented by GUI windows which - * want to store their contents as a user preference item. - * - */ -class ContentsStorable -{ - public: - - /** - * Virtual destructor. - */ - virtual - ~ContentsStorable(void) throw () - { - } - - /** - * Return the user preferences key. - * The contents of the window will be stored in the user preferences - * under this key. - * - * @return the user preference key. - */ - virtual Ptr::Ref - getUserPreferencesKey(void) throw () - = 0; - - /** - * Convert the contents of the window to a string. - * - * @return the contents of the window, as a string. - */ - virtual Ptr::Ref - getContents(void) throw () - = 0; - - /** - * Restore the contents of the window. - * - * @param contents the new contents (as a string); it will replace - * the current contents of the window - */ - virtual void - setContents(Ptr::Ref contents) throw () - = 0; -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // ContentsStorable_h - diff --git a/src/products/gLiveSupport/src/CuePlayer.cxx b/src/products/gLiveSupport/src/CuePlayer.cxx deleted file mode 100644 index b16097bfd..000000000 --- a/src/products/gLiveSupport/src/CuePlayer.cxx +++ /dev/null @@ -1,234 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "CuePlayer.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/** - * The string which identifies the Play stock image. - */ -const Glib::ustring playStockImageName = "gtk-media-play"; - -/** - * The string which identifies the Pause stock image. - */ -const Glib::ustring pauseStockImageName = "gtk-media-pause"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -CuePlayer :: CuePlayer(GuiObject * parent, - Gtk::TreeView * treeView, - const PlayableTreeModelColumnRecord & modelColumns) - throw () - : GuiComponent(parent), - treeView(treeView), - modelColumns(modelColumns) -{ - glade->get_widget("cuePlayButton1", playButton); - glade->get_widget("cueStopButton1", stopButton); - - playButton->signal_clicked().connect(sigc::mem_fun(*this, - &CuePlayer::onPlayButtonClicked )); - stopButton->signal_clicked().connect(sigc::mem_fun(*this, - &CuePlayer::onStopButtonClicked )); - - audioState = waitingState; - - gLiveSupport->attachCueAudioListener(this); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -CuePlayer :: ~CuePlayer(void) throw () -{ - try { - gLiveSupport->detachCueAudioListener(this); - } catch (std::invalid_argument &e) { - std::cerr << "Could not detach cue player audio listener." - << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Play menu item selected from the entry context menu - *----------------------------------------------------------------------------*/ -void -CuePlayer :: onPlayItem(void) throw () -{ - Glib::RefPtr - selection = treeView->get_selection(); - std::vector - selectedRows = selection->get_selected_rows(); - Gtk::TreeIter iter; - - if (selectedRows.size() > 0) { - Gtk::TreePath path = selectedRows.front(); - iter = treeView->get_model()->get_iter(path); - } else { - iter = treeView->get_model()->children().begin(); - } - - if (iter) { - Ptr::Ref playable = (*iter)[modelColumns.playableColumn]; - try { - setAudioState(playingState); - gLiveSupport->playCueAudio(playable); - } catch (std::runtime_error &e) { - std::cerr << "GLiveSupport::playCueAudio() error:" - << std::endl << e.what() << std::endl; - } - } -} - - -/*------------------------------------------------------------------------------ - * Pause the song. - *----------------------------------------------------------------------------*/ -void -CuePlayer :: onPauseItem(void) throw () -{ - try { - gLiveSupport->pauseCueAudio(); - setAudioState(pausedState); - } catch (std::logic_error &e) { - std::cerr << "GLiveSupport::pauseCueAudio() error:" << std::endl - << e.what() << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Play button getting clicked - *----------------------------------------------------------------------------*/ -void -CuePlayer :: onPlayButtonClicked(void) throw () -{ - switch (audioState) { - case waitingState: - onPlayItem(); - break; - - case playingState: - onPauseItem(); - break; - - case pausedState: - try { - gLiveSupport->pauseCueAudio(); // ie, restart - setAudioState(playingState); - } catch (std::logic_error &e) { - std::cerr << "GLiveSupport::pauseCueAudio() error:" << std::endl - << e.what() << std::endl; - } - break; - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Stop button getting clicked - *----------------------------------------------------------------------------*/ -void -CuePlayer :: onStopButtonClicked(void) throw () -{ - if (audioState != waitingState) { - try { - gLiveSupport->stopCueAudio(); - } catch (std::logic_error &e) { - std::cerr << "GLiveSupport::stopCueAudio() error:" << std::endl - << e.what() << std::endl; - } - setAudioState(waitingState); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the "cue audio player has stopped" event. - *----------------------------------------------------------------------------*/ -void -CuePlayer :: onStop(Ptr::Ref errorMessage) throw () -{ - setAudioState(waitingState); - - if (errorMessage) { - gLiveSupport->displayMessageWindow(*errorMessage); - } -} - -/*------------------------------------------------------------------------------ - * Event handler for the "cue audio player has started" event. - *----------------------------------------------------------------------------*/ -void -CuePlayer :: onStart(gint64 id) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Set the state of the widget. - *----------------------------------------------------------------------------*/ -void -CuePlayer :: setAudioState(AudioState newState) throw () -{ - if ((audioState == waitingState || audioState == pausedState) - && newState == playingState) { - playButton->set_label(pauseStockImageName); - - } else if (audioState == playingState - && (newState == waitingState || newState == pausedState)) { - playButton->set_label(playStockImageName); - } - - audioState = newState; -} - diff --git a/src/products/gLiveSupport/src/CuePlayer.h b/src/products/gLiveSupport/src/CuePlayer.h deleted file mode 100644 index 7a65499b9..000000000 --- a/src/products/gLiveSupport/src/CuePlayer.h +++ /dev/null @@ -1,192 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef CuePlayer_h -#define CuePlayer_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerEventListener.h" -#include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A box displaying a play/pause and a stop button, which control the cue - * (preview) audio player. - * - */ -class CuePlayer : public GuiComponent, - public PlaylistExecutor::AudioPlayerEventListener -{ - private: - - /** - * The possible states of the (cue) audio player. - */ - enum AudioState { waitingState, playingState, pausedState }; - - /** - * The current state of the player. - */ - AudioState audioState; - - /** - * The play button. - */ - Gtk::Button * playButton; - - /** - * The stop button. - */ - Gtk::Button * stopButton; - - /** - * The Gtk::TreeView of the parent. - */ - Gtk::TreeView * treeView; - - /** - * The Gtk::TreeModelColumnRecord of the parent. - */ - const PlayableTreeModelColumnRecord & - modelColumns; - - /** - * Default constructor. - */ - CuePlayer(void) throw (); - - /** - * Pause the song. - */ - void - onPauseItem(void) throw (); - - /** - * Event handler for the Play button being clicked. - */ - void - onPlayButtonClicked(void) throw (); - - /** - * Event handler for the Stop button being clicked. - */ - void - onStopButtonClicked(void) throw (); - - /** - * Set the state of the widget. - * It sets the value of the audioState variable, and changes the - * play/pause button if necessary. - * - * @param newState the new value of the audioState variable. - */ - void - setAudioState(AudioState newState) throw (); - - - public: - - /** - * Constructor with parent parameters. - * - * @param parent the GuiObject which contains this one. - * @param treeView the TreeView object showing the selection. - * @param modelColumns the object holding the types of the columns. - */ - CuePlayer(GuiObject * parent, - Gtk::TreeView * treeView, - const PlayableTreeModelColumnRecord & modelColumns) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~CuePlayer(void) throw (); - - /** - * Signal handler for the "play item" menu item selected - * from the entry context menu. - */ - void - onPlayItem(void) throw (); - - /** - * Event handler for the "cue audio player has stopped" event. - * - * @param errorMessage is a 0 pointer if the player stopped normally - */ - virtual void - onStop(Ptr::Ref errorMessage - = Ptr::Ref()) - throw (); - - /** - * Event handler for the "cue audio player has started" event. - * - * @param fileName - */ - virtual void - onStart(gint64 id) - throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // CuePlayer_h - diff --git a/src/products/gLiveSupport/src/DateTimeChooserWindow.cxx b/src/products/gLiveSupport/src/DateTimeChooserWindow.cxx deleted file mode 100644 index c1faa7e3e..000000000 --- a/src/products/gLiveSupport/src/DateTimeChooserWindow.cxx +++ /dev/null @@ -1,117 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "DateTimeChooserWindow.h" - - -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "dateTimeChooserWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "DateTimeChooserWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -DateTimeChooserWindow :: DateTimeChooserWindow (void) - throw () - : GuiWindow(bundleName, - gladeFileName) -{ - Gtk::Label * hourLabel; - Gtk::Label * minuteLabel; - glade->get_widget("hourLabel1", hourLabel); - glade->get_widget("minuteLabel1", minuteLabel); - hourLabel->set_label(*getResourceUstring("hourLabel")); - minuteLabel->set_label(*getResourceUstring("minuteLabel")); - - glade->get_widget("calendar1", calendar); - glade->get_widget("hourSpinButton1", hourEntry); - glade->get_widget("minuteSpinButton1", minuteEntry); - - glade->get_widget("okButton1", okButton); - okButton->signal_clicked().connect(sigc::mem_fun(*this, - &DateTimeChooserWindow::onOkButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the OK button clicked. - *----------------------------------------------------------------------------*/ -void -DateTimeChooserWindow :: onOkButtonClicked(void) throw () -{ - unsigned int year; - unsigned int month; - unsigned int day; - calendar->get_date(year, month, day); - ++month; // Gtk+ months are 0-based, Boost months are 1-based - - int hours = hourEntry->get_value_as_int(); - int minutes = minuteEntry->get_value_as_int(); - - chosenDateTime.reset(new boost::posix_time::ptime( - boost::gregorian::date(year, month, day), - boost::posix_time::time_duration(hours, minutes, 0) )); - - mainWindow->hide(); -} - - -/*------------------------------------------------------------------------------ - * Show the window and return the button clicked. - *----------------------------------------------------------------------------*/ -Ptr::Ref -DateTimeChooserWindow :: run(void) throw () -{ - chosenDateTime.reset(); - Gtk::Main::run(*mainWindow); - return chosenDateTime; -} - diff --git a/src/products/gLiveSupport/src/DateTimeChooserWindow.h b/src/products/gLiveSupport/src/DateTimeChooserWindow.h deleted file mode 100644 index f85943c60..000000000 --- a/src/products/gLiveSupport/src/DateTimeChooserWindow.h +++ /dev/null @@ -1,143 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef DateTimeChooserWindow_h -#define DateTimeChooserWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "GLiveSupport.h" - -#include "GuiWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A dialog window for choosing a date/time. - * - * The return value of the run() method is a boost::posix_time::ptime value. - * The DateTimeChooserWindow object is not destroyed when it returns from - * run(); it is the responsibility of the caller to delete it (or it can be - * reused a few times first). - * - */ -class DateTimeChooserWindow : public GuiWindow -{ - private: - - /** - * The calendar where the date is chosen. - */ - Gtk::Calendar * calendar; - - /** - * The entry field for hours. - */ - Gtk::SpinButton * hourEntry; - - /** - * The entry field for minutes. - */ - Gtk::SpinButton * minuteEntry; - - /** - * The OK button - */ - Gtk::Button * okButton; - - /** - * The return value; set to 0 if the user closed the window. - */ - Ptr::Ref chosenDateTime; - - - protected: - - /** - * The event handler for the OK button clicked. - */ - virtual void - onOkButtonClicked(void) throw (); - - - public: - - /** - * Constructor. - */ - DateTimeChooserWindow(void) - throw (); - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~DateTimeChooserWindow(void) throw () - { - } - - /** - * Run the window and return the date/time selected. - * The returned value may be a 0 pointer (if the user pressed Cancel), - * and it may be not_a_date_time, if the user's selection is invalid. - */ - Ptr::Ref - run(void) throw (); - -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // DateTimeChooserWindow_h - diff --git a/src/products/gLiveSupport/src/DndMethods.cxx b/src/products/gLiveSupport/src/DndMethods.cxx deleted file mode 100644 index 1a8ea23fc..000000000 --- a/src/products/gLiveSupport/src/DndMethods.cxx +++ /dev/null @@ -1,181 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "DndMethods.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the D'n'D callbacks. - *----------------------------------------------------------------------------*/ -void -DndMethods :: setupDndCallbacks (DndType type) throw () -{ - Gtk::TreeView * treeView = getTreeViewForDnd(); - - std::list targets; - targets.push_back(Gtk::TargetEntry("STRING", - Gtk::TARGET_SAME_APP)); - - if (type | DND_SOURCE) { - treeView->enable_model_drag_source(targets); - treeView->signal_drag_data_get().connect(sigc::mem_fun(*this, - &DndMethods::onTreeViewDragDataGet)); - } - - if (type | DND_DEST) { - treeView->enable_model_drag_dest(targets); - treeView->signal_drag_data_received().connect(sigc::mem_fun(*this, - &DndMethods::onTreeViewDragDataReceived)); - } -} - - -/*------------------------------------------------------------------------------ - * The callback for supplying the data for the drag and drop. - *----------------------------------------------------------------------------*/ -void -DndMethods :: onTreeViewDragDataGet ( - const Glib::RefPtr & context, - Gtk::SelectionData & selectionData, - guint info, - guint time) - throw () -{ - Glib::ustring dropString = getWindowNameForDnd(); - Ptr::Ref playable = getFirstSelectedPlayable(); - - while ((playable = getNextSelectedPlayable())) { - dropString += " "; - dropString += std::string(*playable->getId()); - } - - selectionData.set(selectionData.get_target(), - 8 /* 8 bits format*/, - (const guchar *) dropString.c_str(), - dropString.bytes()); -} - - -/*------------------------------------------------------------------------------ - * The callback for processing the data delivered by drag and drop. - *----------------------------------------------------------------------------*/ -void -DndMethods :: onTreeViewDragDataReceived( - const Glib::RefPtr & context, - int x, - int y, - const Gtk::SelectionData & selectionData, - guint info, - guint time) - throw () -{ - Glib::ustring windowName = getWindowNameForDnd(); - - if (selectionData.get_length() < 0 || selectionData.get_format() != 8) { - std::cerr << "unknown type of data dropped on the tree view in " - << windowName << std::endl; - context->drag_finish(false, false, time); - return; - } - - Glib::ustring data = selectionData.get_data_as_string(); - std::stringstream dataStream(data); - Glib::ustring sourceWindow; - dataStream >> sourceWindow; - - Gtk::TreeIter iter = insertRowAtPos(x, y); - Glib::ustring idAsString; - dataStream >> idAsString; // only works for 1 item, for now - Ptr::Ref id(new UniqueId(idAsString)); - addItem(iter, id); - - if (sourceWindow == windowName) { - context->drag_finish(true, true, time); // delete the original - - } else { - context->drag_finish(true, false, time); // don't delete the original - } -} - - -/*------------------------------------------------------------------------------ - * Insert a row into the tree model at the given tree view position. - *----------------------------------------------------------------------------*/ -Gtk::TreeIter -DndMethods :: insertRowAtPos (int x, - int y) throw () -{ - Gtk::TreeView * treeView = getTreeViewForDnd(); - Glib::RefPtr - treeModel = Glib::RefPtr::cast_dynamic( - treeView->get_model() ); - - Gtk::TreePath destPath; - Gtk::TreeViewDropPosition destPos; - bool pathIsValid = treeView->get_dest_row_at_pos( - x, y, destPath, destPos); - // get_drag_dest_row() does not work here, for some strange reason - Gtk::TreeIter newIter; - - if (pathIsValid) { - assert (!destPath.empty()); - Gtk::TreeIter destination = treeModel->get_iter(destPath); - - if (destPos == Gtk::TREE_VIEW_DROP_BEFORE - || destPos == Gtk::TREE_VIEW_DROP_INTO_OR_BEFORE) { - newIter = treeModel->insert(destination); - - } else if (destPos == Gtk::TREE_VIEW_DROP_AFTER - || destPos == Gtk::TREE_VIEW_DROP_INTO_OR_AFTER) { - newIter = treeModel->insert_after(destination); - - } else { - assert (false); - } - } else { - newIter = treeModel->append(); - } - - return newIter; -} - diff --git a/src/products/gLiveSupport/src/DndMethods.h b/src/products/gLiveSupport/src/DndMethods.h deleted file mode 100644 index f166176f8..000000000 --- a/src/products/gLiveSupport/src/DndMethods.h +++ /dev/null @@ -1,197 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef DndMethods_h -#define DndMethods_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#include - -#include "LiveSupport/Core/Playable.h" - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An abstract class containing template methods which implement drag and drop. - * - * To implement d'n'd in a GuiWindow, inherit from this class, implement the - * pure abstract methods declared in this class (see the requirements at the - * method declarations), and call setupDndCallbacks() after the tree view has - * been constructed. - * - */ -class DndMethods -{ - protected: - - /** - * The tree view we want to implement d'n'd on. - */ - virtual Gtk::TreeView * - getTreeViewForDnd (void) throw () - = 0; - - /** - * The name of the window. - */ - virtual Glib::ustring - getWindowNameForDnd (void) throw () - = 0; - - /** - * Return the topmost selected row in the tree view. - * - * @return the first selected playable item. - */ - virtual Ptr::Ref - getFirstSelectedPlayable(void) throw () - = 0; - - /** - * Used to iterate over the selected rows in the tree view. - * - * @return the next selected playable item. - */ - virtual Ptr::Ref - getNextSelectedPlayable(void) throw () - = 0; - - /** - * Add an item to the d'n'd tree view at the given position. - * - * @param iter the iterator pointing to the row to be filled in. - * @param id the ID of the item to add. - */ - virtual void - addItem (Gtk::TreeIter iter, - Ptr::Ref id) throw () - = 0; - - /** - * Insert a row into the tree model at the given tree view position. - * Creates the new row; the caller should fill it with data. - * - * @param x the x coordinate of the location of the new row. - * @param y the y coordinate of the location of the new row. - * @return an iterator pointing to the newly created row. - */ - Gtk::TreeIter - insertRowAtPos (int x, - int y) throw (); - - /** - * Types of d'n'd. - */ - typedef enum { DND_SOURCE = 1, - DND_DEST = 2 - } DndType; - - /** - * Set up the d'n'd callbacks. - * - * @param type set up callbacks for d'n'd source or destination - * (default: both). - */ - void - setupDndCallbacks (DndType type = DndType(DND_SOURCE | DND_DEST)) - throw (); - - /** - * The callback for supplying the data for the drag and drop. - * - * @param context the drag context. - * @param selectionData the data (filled in by this function). - * @param info not used. - * @param time timestamp for the d'n'd operation. - */ - void - onTreeViewDragDataGet ( - const Glib::RefPtr & context, - Gtk::SelectionData & selectionData, - guint info, - guint time) - throw (); - - /** - * The callback for processing the data delivered by drag and drop. - * - * @param context the drag context. - * @param x the x coord where the data was dropped. - * @param y the y coord where the data was dropped. - * @param selectionData the data. - * @param info not used. - * @param time timestamp for the d'n'd operation. - */ - virtual void - onTreeViewDragDataReceived ( - const Glib::RefPtr & context, - int x, - int y, - const Gtk::SelectionData & selectionData, - guint info, - guint time) - throw (); - - /** - * Constructor. - */ - DndMethods (void) throw () - { - } - - /** - * Virtual destructor. - */ - virtual - ~DndMethods(void) throw () - { - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // DndMethods_h - diff --git a/src/products/gLiveSupport/src/ExportFormatRadioButtons.cxx b/src/products/gLiveSupport/src/ExportFormatRadioButtons.cxx deleted file mode 100644 index 069746b4a..000000000 --- a/src/products/gLiveSupport/src/ExportFormatRadioButtons.cxx +++ /dev/null @@ -1,82 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "ExportFormatRadioButtons.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ExportFormatRadioButtons :: ExportFormatRadioButtons(GuiObject * parent) - throw () - : GuiComponent(parent) -{ - glade->get_widget("internalFormatRadioButton1", internalFormatRadioButton); - glade->get_widget("smilFormatRadioButton1", smilFormatRadioButton); - internalFormatRadioButton->set_label(*getResourceUstring( - "internalFormatName")); - smilFormatRadioButton->set_label(*getResourceUstring( - "smilFormatName")); -} - - -/*------------------------------------------------------------------------------ - * Return the format which is currently selected. - *----------------------------------------------------------------------------*/ -StorageClientInterface::ExportFormatType -ExportFormatRadioButtons :: getFormat(void) throw () -{ - if (internalFormatRadioButton->get_active()) { - return StorageClientInterface::internalFormat; - - } else if (smilFormatRadioButton->get_active()) { - return StorageClientInterface::smilFormat; - - } else { - std::cerr << "impossible value in ExportFormatRadioButtons::getFormat()" - << std::endl; - std::exit(1); - } -} - diff --git a/src/products/gLiveSupport/src/ExportFormatRadioButtons.h b/src/products/gLiveSupport/src/ExportFormatRadioButtons.h deleted file mode 100644 index 55d5eba12..000000000 --- a/src/products/gLiveSupport/src/ExportFormatRadioButtons.h +++ /dev/null @@ -1,99 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ExportFormatRadioButtons_h -#define ExportFormatRadioButtons_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#include "LiveSupport/StorageClient/StorageClientInterface.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A specialized group of radio buttons, holding the - * StorageClientInterface::ExportFormatType options. - * - */ -class ExportFormatRadioButtons : public GuiComponent -{ - private: - - /** - * The radio button for the internal Campcaster format. - */ - Gtk::RadioButton * internalFormatRadioButton; - - /** - * The radio button for the SMIL format. - */ - Gtk::RadioButton * smilFormatRadioButton; - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - */ - ExportFormatRadioButtons(GuiObject * parent) - throw (); - - /** - * Return the format which is currently selected. - */ - StorageClientInterface::ExportFormatType - getFormat(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // ExportFormatRadioButtons_h - diff --git a/src/products/gLiveSupport/src/ExportPlaylistWindow.cxx b/src/products/gLiveSupport/src/ExportPlaylistWindow.cxx deleted file mode 100644 index d7fb5c4b9..000000000 --- a/src/products/gLiveSupport/src/ExportPlaylistWindow.cxx +++ /dev/null @@ -1,217 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_PWD_H -#include -#else -#error need pwd.h -#endif - -#include "LiveSupport/Core/FileTools.h" - -#include "ExportPlaylistWindow.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "exportPlaylistWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "ExportPlaylistWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ExportPlaylistWindow :: ExportPlaylistWindow(Ptr::Ref playlist) - throw () - : GuiWindow(bundleName, - gladeFileName), - playlist(playlist) -{ - Gtk::Label * playlistTitleTextLabel; - Gtk::Label * formatLabel; - glade->get_widget("playlistTitleTextLabel1", playlistTitleTextLabel); - glade->get_widget("formatLabel1", formatLabel); - playlistTitleTextLabel->set_label(*getResourceUstring( - "playlistTitleLabel")); - formatLabel->set_label(*getResourceUstring("formatLabel")); - - Gtk::Label * playlistTitleValueLabel; - glade->get_widget("playlistTitleValueLabel1", playlistTitleValueLabel); - playlistTitleValueLabel->set_label(*playlist->getTitle()); - - glade->connect_clicked("cancelButton1", sigc::mem_fun(*this, - &ExportPlaylistWindow::onCancelButtonClicked)); - glade->connect_clicked("saveButton1", sigc::mem_fun(*this, - &ExportPlaylistWindow::onSaveButtonClicked)); - - formatButtons.reset(new ExportFormatRadioButtons(this)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Cancel button being clicked. - *----------------------------------------------------------------------------*/ -void -ExportPlaylistWindow :: onCancelButtonClicked(void) throw () -{ - mainWindow->hide(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Save button being clicked. - *----------------------------------------------------------------------------*/ -void -ExportPlaylistWindow :: onSaveButtonClicked(void) throw () -{ - if (token) { - resetToken(); - } - - // run the storage method - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - Ptr::Ref playlistId = playlist->getId(); - StorageClientInterface::ExportFormatType - format = formatButtons->getFormat(); - Ptr::Ref url(new Glib::ustring); - - try { - token = storage->exportPlaylistOpen(sessionId, playlistId, format, url); - } catch (XmlRpcException &e) { - Ptr::Ref errorMsg = getResourceUstring( - "createExportErrorMsg"); - errorMsg->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMsg); - return; - } - - // run the file chooser dialog - Ptr::Ref dialog; - try { - dialog.reset(new Gtk::FileChooserDialog( - *getResourceUstring("fileChooserDialogTitle"), - Gtk::FILE_CHOOSER_ACTION_SAVE)); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - std::exit(1); - } - - struct passwd * pwd = getpwuid(getuid()); - if (pwd) { - dialog->set_current_folder(pwd->pw_dir); - } - - Ptr::Ref fileName(new Glib::ustring( - *playlist->getTitle())); - fileName->append(".tar"); - dialog->set_current_name(*fileName); - - dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog->add_button(Gtk::Stock::SAVE, Gtk::RESPONSE_OK); - - int result = dialog->run(); - - // save the exported playlist as a local file - if (result == Gtk::RESPONSE_OK) { - fileName->assign(dialog->get_filename()); - try { - FileTools::copyUrlToFile(*url, *fileName); - - } catch (std::runtime_error &e) { - Ptr::Ref errorMsg = getResourceUstring( - "saveExportErrorMsg"); - gLiveSupport->displayMessageWindow(*errorMsg); - } - } - - // close the exporting operation - resetToken(); - - mainWindow->hide(); -} - - -/*------------------------------------------------------------------------------ - * Cancel the current operation. - *----------------------------------------------------------------------------*/ -void -ExportPlaylistWindow :: resetToken(void) throw () -{ - Ptr::Ref storage - = gLiveSupport->getStorageClient(); - try { - storage->exportPlaylistClose(token); - token.reset(); - - } catch (XmlRpcException &e) { - Ptr::Ref errorMsg = getResourceUstring( - "createExportErrorMsg"); - errorMsg->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler called when the the window gets hidden. - *----------------------------------------------------------------------------*/ -bool -ExportPlaylistWindow :: onDeleteEvent(GdkEventAny * event) throw () -{ -std::cerr << "ExportPlaylistWindow :: onDeleteEvent called\n"; - if (token) { - resetToken(); - } - - return false; -} - diff --git a/src/products/gLiveSupport/src/ExportPlaylistWindow.h b/src/products/gLiveSupport/src/ExportPlaylistWindow.h deleted file mode 100644 index a88ce0e99..000000000 --- a/src/products/gLiveSupport/src/ExportPlaylistWindow.h +++ /dev/null @@ -1,147 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ExportPlaylistWindow_h -#define ExportPlaylistWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Playlist.h" -#include "ExportFormatRadioButtons.h" -#include "GLiveSupport.h" - -#include "GuiWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The Export Playlist window. This is a pop-up window accessible from the - * right-click menus of the Scratchpad, Live Mode and Search/Browse windows. - * It lets the user select the format of the exported playlist, and the - * location where it will be saved. - * - */ -class ExportPlaylistWindow : public GuiWindow -{ - private: - - /** - * The playlist to be exported. - */ - Ptr::Ref playlist; - - /** - * The playlist to be exported. - */ - Ptr::Ref token; - - /** - * The radio buttons for selecting the export format. - */ - Ptr::Ref formatButtons; - - /** - * Cancel the current operation. - * Call exportPlaylistClose() on token, and reset it to 0. - */ - void - resetToken(void) throw (); - - - protected: - - /** - * Event handler for the Cancel button being clicked. - */ - void - onCancelButtonClicked(void) throw (); - - /** - * Event handler for the Save button being clicked. - */ - void - onSaveButtonClicked(void) throw (); - - /** - * Event handler called when the the window gets hidden. - * It closes the exporting operations, if there is one in progress. - * - * Overrides GuiWindow::onDeleteEvent(). - * - * @param event attributes of the event. - * @return true if handled the event, false to continue deleting. - */ - virtual bool - onDeleteEvent(GdkEventAny * event) throw (); - - - public: - - /** - * Constructor. - * - * @param playlist the playlist to be exported. - */ - ExportPlaylistWindow(Ptr::Ref playlist) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~ExportPlaylistWindow(void) throw () - { - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // ExportPlaylistWindow_h - diff --git a/src/products/gLiveSupport/src/GLiveSupport.cxx b/src/products/gLiveSupport/src/GLiveSupport.cxx deleted file mode 100644 index 5d90d0d4c..000000000 --- a/src/products/gLiveSupport/src/GLiveSupport.cxx +++ /dev/null @@ -1,1985 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_PWD_H -#include -#else -#error need pwd.h -#endif - -#ifdef HAVE_SYS_STAT_H -#include -#else -#error need sys/stat.h -#endif - -#ifdef HAVE_STDLIB_H -#include -#else -#error need stdlib.h -#endif - -#include -#include - -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Core/XmlRpcInvalidDataException.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/SchedulerClient/SchedulerClientFactory.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h" - -#include "MasterPanelWindow.h" -#include "GLiveSupport.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::SchedulerClient; -using namespace LiveSupport::Widgets; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string - LiveSupport :: GLiveSupport :: GLiveSupport :: configElementNameStr - = "gLiveSupport"; - -/*------------------------------------------------------------------------------ - * The singleton instance of GLiveSupport - *----------------------------------------------------------------------------*/ -Ptr::Ref - LiveSupport :: GLiveSupport :: GLiveSupport :: singleton; - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the configuration file for this class - *----------------------------------------------------------------------------*/ -const std::string configFileDirStr = "/.campcaster/"; - -/*------------------------------------------------------------------------------ - * The name of the configuration file for this class - *----------------------------------------------------------------------------*/ -const std::string configFileNameStr = "campcaster-studio.xml"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the list of supported languages - *----------------------------------------------------------------------------*/ -const std::string supportedLanguagesElementName = "supportedLanguages"; - -/*------------------------------------------------------------------------------ - * The name of the config element for a supported language. - *----------------------------------------------------------------------------*/ -const std::string languageElementName = "language"; - -/*------------------------------------------------------------------------------ - * The name of the attribute for the locale id for a supported language - *----------------------------------------------------------------------------*/ -const std::string localeAttrName = "locale"; - -/*------------------------------------------------------------------------------ - * The name of the attribute for the name for a supported language - *----------------------------------------------------------------------------*/ -const std::string nameAttrName = "name"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the directory where the Glade files are - *----------------------------------------------------------------------------*/ -const std::string gladeDirConfigElementName = "gladeDirectory"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const std::string gladeFileName = "GLiveSupport.glade"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the scheduler daemon start command - *----------------------------------------------------------------------------*/ -const std::string schedulerDaemonCommandsElementName - = "schedulerDaemonCommands"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the sound output player - *----------------------------------------------------------------------------*/ -const std::string outputPlayerElementName = "outputPlayer"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the sound cue player - *----------------------------------------------------------------------------*/ -const std::string cuePlayerElementName = "cuePlayer"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the station logo image - *----------------------------------------------------------------------------*/ -const std::string stationLogoConfigElementName = "stationLogo"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the taskbar icon images - *----------------------------------------------------------------------------*/ -const std::string taskbarIconsConfigElementName = "taskbarIcons"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the test audio file location - *----------------------------------------------------------------------------*/ -const std::string testAudioUrlConfigElementName = "testAudioUrl"; - -/*------------------------------------------------------------------------------ - * The name of the user preference for storing window positions - *----------------------------------------------------------------------------*/ -const std::string windowPositionsKey = "windowPositions"; - -/*------------------------------------------------------------------------------ - * The name of the user preference for storing the token of the edited p.l. - *----------------------------------------------------------------------------*/ -const std::string editedPlaylistTokenKey = "editedPlaylistToken"; - -/*------------------------------------------------------------------------------ - * Static constant for the key of the scheduler not available error message - *----------------------------------------------------------------------------*/ -const std::string schedulerNotReachableKey = "schedulerNotReachableMsg"; - -/*------------------------------------------------------------------------------ - * Static constant for the key of the storage not available error message - *----------------------------------------------------------------------------*/ -const std::string storageNotReachableKey = "storageNotReachableMsg"; - -/*------------------------------------------------------------------------------ - * Static constant for the key of the authentication not available error msg - *----------------------------------------------------------------------------*/ -const std::string authenticationNotReachableKey = - "authenticationNotReachableMsg"; - -/*------------------------------------------------------------------------------ - * Static constant for the key of the locale not available error message - *----------------------------------------------------------------------------*/ -const std::string localeNotAvailableKey = "localeNotAvailableMsg"; - -/*------------------------------------------------------------------------------ - * The name of the config element for the serial device - *----------------------------------------------------------------------------*/ -const std::string serialPortConfigElementName = "serialPort"; - -/*------------------------------------------------------------------------------ - * The default serial device - *----------------------------------------------------------------------------*/ -const std::string serialPortDefaultDevice = "/dev/ttyS0"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new LiveSupport::GLiveSupport::GLiveSupport()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the gLiveSupport object - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - xmlpp::Node::NodeList nodes; - - // read the list of supported languages - nodes = element.get_children(supportedLanguagesElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no supportedLanguages element"); - } - configSupportedLanguages( - *dynamic_cast(nodes.front())); - - // configure the resource bundle - nodes = element.get_children(LocalizedObject::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no resourceBundle element"); - } - LocalizedConfigurable::configure( - *dynamic_cast(nodes.front()) ); - - // configure the AuthenticationClientFactory - nodes = element.get_children( - AuthenticationClientFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no authenticationClientFactory element"); - } - Ptr::Ref acf - = AuthenticationClientFactory::getInstance(); - acf->configure(*dynamic_cast(nodes.front())); - - authentication = acf->getAuthenticationClient(); - - // configure the StorageClientFactory - nodes = element.get_children(StorageClientFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no storageClientFactory element"); - } - Ptr::Ref stcf = StorageClientFactory::getInstance(); - stcf->configure(*dynamic_cast(nodes.front())); - - storage = stcf->getStorageClient(); - - // configure the directory where the Glade files are - nodes = element.get_children(gladeDirConfigElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no gladeDirectory element"); - } - const xmlpp::Element* gladeDirElement - = dynamic_cast(nodes.front()); - gladeDir = gladeDirElement->get_attribute("path") - ->get_value(); - glade = Gnome::Glade::Xml::create(gladeDir + gladeFileName); - - // configure the WidgetFactory - nodes = element.get_children(WidgetFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no widgetFactory element"); - } - widgetFactory = WidgetFactory::getInstance(); - widgetFactory->configure( - *dynamic_cast(nodes.front()) ); - - // configure the SchedulerClientFactory - nodes = element.get_children( - SchedulerClientFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no schedulerClientFactory element"); - } - Ptr::Ref schcf - = SchedulerClientFactory::getInstance(); - schcf->configure(*dynamic_cast(nodes.front())); - - scheduler = schcf->getSchedulerClient(); - - // configure the scheduler daemon start and stop command strings - nodes = element.get_children(schedulerDaemonCommandsElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no scheduler daemon commands element"); - } - const xmlpp::Element* schedulerDaemonCommandsElement - = dynamic_cast(nodes.front()); - xmlpp::Attribute * schedulerDaemonStartAttribute - = schedulerDaemonCommandsElement->get_attribute( - "start"); - xmlpp::Attribute * schedulerDaemonStopAttribute - = schedulerDaemonCommandsElement->get_attribute( - "stop"); - if (!schedulerDaemonStartAttribute) { - throw std::invalid_argument("missing scheduler start command"); - } - if (!schedulerDaemonStopAttribute) { - throw std::invalid_argument("missing scheduler stop command"); - } - - schedulerDaemonStartCommand.reset(new Glib::ustring( - schedulerDaemonStartAttribute->get_value())); - - schedulerDaemonStopCommand.reset(new Glib::ustring( - schedulerDaemonStopAttribute->get_value())); - - Ptr::Ref apf; - xmlpp::Element * elem; - // configure the outputPlayer AudioPlayerFactory - nodes = element.get_children(outputPlayerElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no outputPlayer element"); - } - elem = (xmlpp::Element*) *(nodes.begin()); - nodes = elem->get_children(AudioPlayerFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no audioPlayer element"); - } - apf = AudioPlayerFactory::getInstance(); - apf->configure(*dynamic_cast(nodes.front())); - - outputPlayer = apf->getAudioPlayer(); - outputPlayer->initialize(); - outputPlayer->attachListener(this); - - // configure the cuePlayer AudioPlayerFactory - nodes = element.get_children(cuePlayerElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no cuePlayer element"); - } - elem = (xmlpp::Element*) *(nodes.begin()); - nodes = elem->get_children(AudioPlayerFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no audioPlayer element"); - } - apf = AudioPlayerFactory::getInstance(); - apf->configure(*dynamic_cast(nodes.front())); - - cuePlayer = apf->getAudioPlayer(); - cuePlayer->initialize(); - - // configure the station logo image - nodes = element.get_children(stationLogoConfigElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no station logo element"); - } - const xmlpp::Element* stationLogoElement - = dynamic_cast(nodes.front()); - const Glib::ustring stationLogoFileName - = stationLogoElement->get_attribute("path") - ->get_value(); - try { - stationLogoPixbuf = Gdk::Pixbuf::create_from_file(stationLogoFileName); - } catch (Glib::FileError &e) { - Glib::ustring errorMsg = "could not open station logo image file: "; - errorMsg += e.what(); - throw std::invalid_argument(errorMsg); - } catch (Gdk::PixbufError &e) { - Glib::ustring errorMsg = "could not create station logo image: "; - errorMsg += e.what(); - throw std::invalid_argument(errorMsg); - } - - // configure the taskbar icon images - nodes = element.get_children(taskbarIconsConfigElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no taskbar icons element"); - } - taskbarIcons.reset(new TaskbarIcons()); - taskbarIcons->configure( - *dynamic_cast(nodes.front()) ); - - // configure the MetadataTypeContainer - nodes = element.get_children(MetadataTypeContainer::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no metadataTypeContainer element"); - } - Ptr::Ref metadataBundle = getBundle("metadataTypes"); - metadataTypeContainer.reset(new MetadataTypeContainer(metadataBundle)); - metadataTypeContainer->configure( - *dynamic_cast(nodes.front()) ); - - // configure the KeyboardShortcutList - nodes = element.get_children( - KeyboardShortcutList::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no keyboardShortcutList element"); - } - keyboardShortcutList.reset(new KeyboardShortcutList); - keyboardShortcutList->configure( - *dynamic_cast(nodes.front()) ); - - // save the configuration so we can modify it later - // TODO: move configuration code to the OptionsContainer class? - Ptr::Ref configFileName(new Glib::ustring); - configFileName->append(Glib::get_home_dir()); - configFileName->append(configFileDirStr); - mkdir(configFileName->c_str(), 0700); // create dir if does not exist - configFileName->append(configFileNameStr); - optionsContainer.reset(new OptionsContainer(element, configFileName)); - - // read the test audio file location - nodes = element.get_children(testAudioUrlConfigElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no test audio url element"); - } - const xmlpp::Element* testAudioUrlElement - = dynamic_cast(nodes.front()); - testAudioUrl.reset(new Glib::ustring( - testAudioUrlElement->get_attribute("path") - ->get_value() )); - - // read the serial port's file name - nodes = element.get_children(serialPortConfigElementName); - if (nodes.size() < 1) { - Ptr::Ref serialDevice(new const Glib::ustring( - serialPortDefaultDevice)); - optionsContainer->setOptionItem(OptionsContainer::serialDeviceName, - serialDevice); - } -} - - -/*------------------------------------------------------------------------------ - * Configure the list of supported languages - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: configSupportedLanguages(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - xmlpp::Node::NodeList nodes; - xmlpp::Node::NodeList::iterator begin; - xmlpp::Node::NodeList::iterator end; - - supportedLanguages.reset(new LanguageMap()); - - // read the list of supported languages - nodes = element.get_children(languageElementName); - begin = nodes.begin(); - end = nodes.end(); - - while (begin != end) { - xmlpp::Element * elem = (xmlpp::Element *) *begin; - xmlpp::Attribute * localeAttr = elem->get_attribute(localeAttrName); - xmlpp::Attribute * nameAttr = elem->get_attribute(nameAttrName); - - std::string locale = localeAttr->get_value().raw(); - Glib::ustring name = nameAttr->get_value(); - - supportedLanguages->insert(std::make_pair(name, locale)); - - begin++; - } -} - - -/*------------------------------------------------------------------------------ - * Check all configured resources - *----------------------------------------------------------------------------*/ -bool -LiveSupport :: GLiveSupport :: -GLiveSupport :: checkConfiguration(void) throw () -{ - // === FATAL ERRORS === - - // first, check if resources are available for all configured languages - LanguageMap::iterator it = supportedLanguages->begin(); - try { - LanguageMap::iterator end = supportedLanguages->end(); - while (it != end) { - changeLocale((*it).second); - ++it; - } - changeLocale(""); - } catch (std::invalid_argument &e) { - Ptr::Ref language(new Glib::ustring((*it).first)); - Ptr::Ref uLanguage = ustringToUnicodeString(language); - Ptr::Ref msg = formatMessage(localeNotAvailableKey, - (*it).first); - displayMessageWindow(*msg); - - changeLocale(""); - return false; - } - - // check if the authentication server is available - try { - authentication->getVersion(); - } catch (XmlRpcException &e) { - displayAuthenticationServerMissingMessage(); - return false; - } - - // === NON-FATAL ERRORS === - - // check if the storage server is available - try { - storage->getVersion(); - storageAvailable = true; - } catch (XmlRpcException &e) { - storageAvailable = false; - displayMessageWindow(*getResourceUstring(storageNotReachableKey)); - } - - // no need to check the widget factory - - // check the scheduler client - checkSchedulerClient(); - if (!isSchedulerAvailable()) { - displayMessageWindow(*getResourceUstring(schedulerNotReachableKey)); - } - - // TODO: check the audio player? - - return true; -} - - -/*------------------------------------------------------------------------------ - * Display a message window. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: displayMessageWindow(const Glib::ustring & message) - throw () -{ - runOkDialog(message); -} - - -/*------------------------------------------------------------------------------ - * Run a dialog window with No and Yes buttons. - *----------------------------------------------------------------------------*/ -Gtk::ResponseType -LiveSupport :: GLiveSupport :: -GLiveSupport :: runNoYesDialog(const Glib::ustring & message) - throw () -{ - return runDialog("noYesDialog", message); -} - - -/*------------------------------------------------------------------------------ - * Run a dialog window with just an OK button. - *----------------------------------------------------------------------------*/ -Gtk::ResponseType -LiveSupport :: GLiveSupport :: -GLiveSupport :: runOkDialog(const Glib::ustring & message) - throw () -{ - return runDialog("okDialog", message); -} - - -/*------------------------------------------------------------------------------ - * Run a dialog window. - *----------------------------------------------------------------------------*/ -Gtk::ResponseType -LiveSupport :: GLiveSupport :: -GLiveSupport :: runDialog(const Glib::ustring & dialogName, - const Glib::ustring & message) - throw () -{ - Gtk::Dialog * dialog; - Gtk::Label * dialogLabel; - glade->get_widget(dialogName + "1", dialog); - glade->get_widget(dialogName + "Label1", dialogLabel); - - Glib::ustring formattedMessage = ""; - formattedMessage += message; - formattedMessage += ""; - dialogLabel->set_label(formattedMessage); - - Gtk::ResponseType response = Gtk::ResponseType(dialog->run()); - dialog->hide(); - return response; -} - - -/*------------------------------------------------------------------------------ - * Show the main window. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: show(void) throw () -{ - masterPanel.reset(new MasterPanelWindow()); - - masterPanel->getWindow()->set_icon_list(taskbarIcons->getIconList()); - masterPanel->getWindow()->set_default_icon_list( - taskbarIcons->getIconList()); - - // Shows the window and returns when it is closed. - Gtk::Main::run(*masterPanel->getWindow()); - - masterPanel.reset(); -} - - -/*------------------------------------------------------------------------------ - * Change the language of the application - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: changeLanguage(Ptr::Ref locale) - throw (std::invalid_argument) -{ - changeLocale(*locale); - - metadataTypeContainer->setBundle(getBundle("metadataTypes")); - - if (masterPanel.get()) { - masterPanel->changeLanguage(); - } -} - - -/*------------------------------------------------------------------------------ - * Authenticate the user - *----------------------------------------------------------------------------*/ -bool -LiveSupport :: GLiveSupport :: -GLiveSupport :: login(const std::string & login, - const std::string & password) throw () -{ - try { - sessionId = authentication->login(login, password); - } catch (XmlRpcException &e) { - return false; - } - - userName.reset(new Glib::ustring(login)); - - Ptr::Ref editedPlaylistToken; - Ptr::Ref editedPlaylistTokenString; - try { - editedPlaylistToken = authentication->loadPreferencesItem( - sessionId, - editedPlaylistTokenKey); - editedPlaylistTokenString.reset(new const std::string( - *editedPlaylistToken )); - } catch (std::invalid_argument &e) { - // no stuck playlist token found; that's OK - } catch (XmlRpcException &e) { - std::cerr << "Problem loading " - << editedPlaylistTokenKey - << " user preference item:" - << std::endl - << e.what(); - } - - if (editedPlaylistTokenString) { - try { - storage->revertPlaylist(editedPlaylistTokenString); - } catch (XmlRpcException &e) { - // sometimes this throws; we don't care - } - - try { - authentication->deletePreferencesItem(sessionId, - editedPlaylistTokenKey); - } catch (XmlRpcException &e) { - std::cerr << "Problem deleting " - << editedPlaylistTokenKey - << " user preference item at login:" - << std::endl - << e.what(); - } - } - - loadWindowPositions(); - - return true; -} - - -/*------------------------------------------------------------------------------ - * Log the user out. - *----------------------------------------------------------------------------*/ -bool -LiveSupport :: GLiveSupport :: -GLiveSupport :: logout(void) throw () -{ - if (!sessionId) { - return false; - } - - if (!masterPanel->cancelEditedPlaylist()) { - return false; // do nothing if the user presses the cancel button - } - - stopCueAudio(); - masterPanel->showAnonymousUI(); - - storeWindowPositions(); - windowPositions.clear(); - - try { - authentication->logout(sessionId); - } catch (XmlRpcException &e) { - std::cerr << "error in GLiveSupport::logout: " - << e.what() << std::endl; - } - sessionId.reset(); - - return true; -} - - -/*------------------------------------------------------------------------------ - * Store the contents of a window as a user preference - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: storeWindowContents(ContentsStorable * window) - throw () -{ - Ptr::Ref userPreferencesKey - = window->getUserPreferencesKey(); - Ptr::Ref windowContents - = window->getContents(); - - try { - authentication->savePreferencesItem(sessionId, - *userPreferencesKey, - windowContents); - } catch (XmlRpcException &e) { - // TODO: signal error - std::cerr << "error saving user preferences: " - << e.what() - << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Load the contents of a window from a user preference - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: loadWindowContents(ContentsStorable * window) - throw () -{ - Ptr::Ref userPreferencesKey - = window->getUserPreferencesKey(); - Ptr::Ref windowContents; - - try { - windowContents = authentication->loadPreferencesItem( - sessionId, - *userPreferencesKey); - } catch (XmlRpcException &e) { - // TODO: signal error - std::cerr << "error loading user preferences: " << e.what() - << std::endl; - return; - } catch (std::invalid_argument &e) { - // no preferences stored for this user yet; no problem - return; - } - - window->setContents(windowContents); -} - - -/*------------------------------------------------------------------------------ - * Open an audio clip, and put it into the internal cache of the GLiveSupport - * object. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: getAudioClip(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref clip; - - AudioClipMap::iterator it = openedAudioClips->find(id->getId()); - if (it != openedAudioClips->end()) { - clip = it->second; - } else { - clip = storage->getAudioClip(sessionId, id); - (*openedAudioClips)[id->getId()] = clip; - } - - return clip; -} - - -/*------------------------------------------------------------------------------ - * Acquire an audio clip, and put it into the internal cache of - * the GLiveSupport object. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: acquireAudioClip(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref clip; - - AudioClipMap::iterator it = openedAudioClips->find(id->getId()); - if (it != openedAudioClips->end()) { - clip = it->second; - } - - if (!clip || !clip->getToken()) { - clip = storage->acquireAudioClip(sessionId, id); - (*openedAudioClips)[id->getId()] = clip; - } - - return clip; -} - - -/*------------------------------------------------------------------------------ - * Open an playlist, and put it into the internal cache of the GLiveSupport - * object. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: getPlaylist(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref playlist; - - PlaylistMap::iterator it = openedPlaylists->find(id->getId()); - if (it != openedPlaylists->end()) { - playlist = it->second; - } else { - playlist = storage->getPlaylist(sessionId, id); - (*openedPlaylists)[id->getId()] = playlist; - } - - return playlist; -} - - -/*------------------------------------------------------------------------------ - * Acquire an playlist, and put it into the internal cache of - * the GLiveSupport object. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: acquirePlaylist(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref playlist; - - PlaylistMap::iterator it = openedPlaylists->find(id->getId()); - if (it != openedPlaylists->end()) { - playlist = it->second; - } - - if (!playlist || !playlist->getUri()) { - playlist = storage->acquirePlaylist(sessionId, id); - (*openedPlaylists)[id->getId()] = playlist; - } - - return playlist; -} - - -/*------------------------------------------------------------------------------ - * Open a Playable object. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: getPlayable(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref playable; - - if (existsPlaylist(id)) { - playable = getPlaylist(id); - - } else if (existsAudioClip(id)) { - playable = getAudioClip(id); - - } else { - throw XmlRpcInvalidArgumentException( - "invalid ID in GLiveSupport::getPlayable"); - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Acquire a Playable object. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: acquirePlayable(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref playable; - - if (existsPlaylist(id)) { - playable = acquirePlaylist(id); - - } else if (existsAudioClip(id)) { - playable = acquireAudioClip(id); - - } else { - throw XmlRpcInvalidArgumentException( - "invalid ID in GLiveSupport::acquirePlayable"); - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Remove a playlist from the playlist cache. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: uncachePlaylist(Ptr::Ref id) - throw (XmlRpcException) -{ - Ptr::Ref playlist; - PlaylistMap::iterator it; - PlaylistMap::iterator end = openedPlaylists->end(); - - if ((it = openedPlaylists->find(id->getId())) != end) { - playlist = (*openedPlaylists)[id->getId()]; - if (playlist->getUri()) { - storage->releasePlaylist(playlist); - } - - openedPlaylists->erase(it); - } -} - - -/*----------------------------------------------------------------------------- - * Release all opened audio clips. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: releaseOpenedAudioClips(void) throw (XmlRpcException) -{ - AudioClipMap::iterator it = openedAudioClips->begin(); - AudioClipMap::iterator end = openedAudioClips->end(); - - while (it != end) { - Ptr::Ref clip = it->second; - - if (clip->getToken().get()) { - storage->releaseAudioClip(clip); - } - - ++it; - } - - openedAudioClips->clear(); -} - - -/*------------------------------------------------------------------------------ - * Release all opened playlists. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: releaseOpenedPlaylists(void) throw (XmlRpcException) -{ - PlaylistMap::iterator it = openedPlaylists->begin(); - PlaylistMap::iterator end = openedPlaylists->end(); - - while (it != end) { - Ptr::Ref playlist = it->second; - - if (playlist->getUri()) { - storage->releasePlaylist(playlist); - } - - ++it; - } - - openedPlaylists->clear(); -} - - -/*------------------------------------------------------------------------------ - * Upload an audio clip to the local storage. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: uploadAudioClip(Ptr::Ref audioClip) - throw (XmlRpcException) -{ - storage->storeAudioClip(sessionId, audioClip); - - // this will also add it to the local cache - addToScratchpad(audioClip); -} - - -/*------------------------------------------------------------------------------ - * Upload a playlist archive to the local storage. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: uploadPlaylistArchive(Ptr::Ref path) - throw (XmlRpcException) -{ - Ptr::Ref id = storage->importPlaylist(sessionId, path); - Ptr::Ref playlist = storage->getPlaylist(sessionId, id); - - // this will also add it to the local cache - addToScratchpad(playlist); - - return playlist; -} - - -/*------------------------------------------------------------------------------ - * Add a file to the Scratchpad, and update it. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: addToScratchpad(Ptr::Ref playable) - throw (XmlRpcException) -{ - if (playable->getType() == Playable::AudioClipType) { - acquireAudioClip(playable->getId()); - } else if (playable->getType() == Playable::PlaylistType) { - acquirePlaylist(playable->getId()); - } - - // this will also add it to the local cache - masterPanel->updateScratchpadWindow(playable); -} - - -/*------------------------------------------------------------------------------ - * Add a file to the Live Mode, and update it. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: addToLiveMode(Ptr::Ref playable) - throw () -{ - masterPanel->updateLiveModeWindow(playable); -} - - -/*------------------------------------------------------------------------------ - * Display the playable item on the master panel as "now playing". - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: setNowPlaying(Ptr::Ref playable) - throw () -{ - // test needed: this gets called indirectly from ~MasterPanelWindow - if (masterPanel) { - masterPanel->setNowPlaying(playable); - } -} - - -/*------------------------------------------------------------------------------ - * Open a playlist for editing. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: openPlaylistForEditing(Ptr::Ref playlistId) - throw (XmlRpcException) -{ - if (masterPanel->cancelEditedPlaylist() == false) { - return; // the user canceled the operation - } - - if (!playlistId.get()) { - playlistId = storage->createPlaylist(sessionId); - } else { - uncachePlaylist(playlistId); - } - - editedPlaylist = storage->editPlaylist(sessionId, playlistId); - editedPlaylist->setMetadata(userName, "dc:creator"); - - try { - Ptr::Ref editToken(new const Glib::ustring( - *editedPlaylist->getEditToken() )); - authentication->savePreferencesItem(sessionId, - editedPlaylistTokenKey, - editToken); - } catch (XmlRpcException &e) { - std::cerr << "Problem saving " - << editedPlaylistTokenKey - << " user preference item:" - << std::endl - << e.what(); - } - - editedPlaylist->createSavedCopy(); - - masterPanel->updatePlaylistWindow(); -} - - -/*------------------------------------------------------------------------------ - * Cancel the edited playlist: undo changes and release the lock. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: cancelEditedPlaylist(void) - throw (XmlRpcException) -{ - if (editedPlaylist) { - if (editedPlaylist->isLocked()) { - editedPlaylist->revertToSavedCopy(); - storage->savePlaylist(sessionId, editedPlaylist); - try { - authentication->deletePreferencesItem(sessionId, - editedPlaylistTokenKey); - } catch (XmlRpcException &e) { - std::cerr << "Problem deleting " - << editedPlaylistTokenKey - << " user preference item at cancel:" - << std::endl - << e.what(); - } - } - editedPlaylist.reset(); - } -} - - -/*------------------------------------------------------------------------------ - * Add a playlist to the currently edited playlist - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: addToPlaylist(Ptr::Ref id) - throw (XmlRpcException) -{ - if (!editedPlaylist.get()) { - openPlaylistForEditing(); - } - - // append the appropriate playable object to the end of the playlist - if (existsPlaylist(id)) { - Ptr::Ref playlist = getPlaylist(id); - editedPlaylist->addPlaylist(playlist, editedPlaylist->getPlaylength()); - } else if (existsAudioClip(id)) { - Ptr::Ref clip = getAudioClip(id); - Ptr::Ref elid = editedPlaylist->addAudioClip(clip, editedPlaylist->getPlaylength()); - - //TODO: for testing only!!!!!!!!! -// editedPlaylist->setClipStart(elid, Ptr::Ref(new time_duration(seconds(5)))); -// editedPlaylist->setClipEnd(elid, Ptr::Ref(new time_duration(seconds(10)))); - } - - masterPanel->updatePlaylistWindow(); - emitSignalEditedPlaylistModified(); -} - - -/*------------------------------------------------------------------------------ - * Save the currently edited playlist in storage - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: savePlaylist(void) - throw (XmlRpcException) -{ - if (editedPlaylist) { - if (editedPlaylist->isLocked()) { - editedPlaylist->deleteSavedCopy(); - storage->savePlaylist(sessionId, editedPlaylist); - try { - authentication->deletePreferencesItem(sessionId, - editedPlaylistTokenKey); - } catch (XmlRpcException &e) { - std::cerr << "Problem deleting " - << editedPlaylistTokenKey - << " user preference item at save:" - << std::endl - << e.what(); - } - // update with new version - // this will also add it to the local cache - uncachePlaylist(editedPlaylist->getId()); - addToScratchpad(editedPlaylist); - refreshPlaylistInLiveMode(editedPlaylist); - } - editedPlaylist.reset(); - } -} - - -/*------------------------------------------------------------------------------ - * Schedule a playlist, then show the scheduler at that timepoint - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: schedulePlaylist(Ptr::Ref playlist, - Ptr::Ref playtime) - throw (XmlRpcException) -{ - scheduler->uploadPlaylist(sessionId, playlist->getId(), playtime); - masterPanel->updateSchedulerWindow(playtime); -} - - -/*------------------------------------------------------------------------------ - * Remove a scheduled entry. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: removeFromSchedule(Ptr::Ref scheduleEntryId) - throw (XmlRpcException) -{ - // for some weird reason, the schedule functions won't accept - // Ptr::Ref, just a non-const version - Ptr::Ref seid(new UniqueId(scheduleEntryId->getId())); - - scheduler->removeFromSchedule(sessionId, seid); -} - - -/*------------------------------------------------------------------------------ - * Preload the item in the output audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: preload(Ptr::Ref playable) - throw () -{ - Ptr::Ref uri = playable->getUri(); - if (uri) { - try { - outputPlayer->preload(*uri); - - } catch (std::invalid_argument) { - std::cerr << "gLiveSupport: invalid argument in preload(" - << *uri - << ")" << std::endl; - } catch (std::runtime_error) { - std::cerr << "gLiveSupport: runtime error in preload(" - << *uri - << ")" << std::endl; - } - } -} - - -/*------------------------------------------------------------------------------ - * Play a Playable object using the output audio player. - *----------------------------------------------------------------------------*/ -bool -LiveSupport :: GLiveSupport :: -GLiveSupport :: playOutputAudio(Ptr::Ref playable) - throw (std::logic_error, - std::runtime_error) -{ - try { - switch (playable->getType()) { - case Playable::AudioClipType: - outputItemPlayingNow = acquireAudioClip(playable->getId()); - if(false == outputPlayer->open(*outputItemPlayingNow->getUri(), (gint64)outputItemPlayingNow->getId()->getId(), 0L)) - { - return false; - } - outputPlayer->start(); - std::cerr << "gLiveSupport: Live Mode playing audio clip '" - << *playable->getTitle() - << "'" << std::endl; - break; - - case Playable::PlaylistType: - outputItemPlayingNow = acquirePlaylist(playable->getId()); - outputPlayer->open(*outputItemPlayingNow->getUri(), (gint64)outputItemPlayingNow->getId()->getId(), 0L); - outputPlayer->start(); - std::cerr << "gLiveSupport: Live Mode playing playlist '" - << *playable->getTitle() - << "'" << std::endl; - break; - - default: // this never happens - break; - } - } catch (XmlRpcException &e) { - Ptr::Ref eMsg - = getResourceUstring("audioErrorMsg"); - eMsg->append("\n"); - eMsg->append(e.what()); - displayMessageWindow(*eMsg); - throw std::runtime_error(e.what()); - } catch (std::invalid_argument &e) { - Ptr::Ref eMsg - = getResourceUstring("audioErrorMsg"); - eMsg->append("\n"); - eMsg->append(e.what()); - displayMessageWindow(*eMsg); - throw std::runtime_error(e.what()); - } catch (std::runtime_error &e) { - Ptr::Ref eMsg - = getResourceUstring("audioErrorMsg"); - eMsg->append("\n"); - eMsg->append(e.what()); - displayMessageWindow(*eMsg); - throw std::runtime_error(e.what()); - } - - outputPlayerIsPaused = false; - return true; -} - - -/*------------------------------------------------------------------------------ - * Pause the output audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: pauseOutputAudio(void) - throw (std::logic_error) -{ - if (!outputPlayerIsPaused && outputPlayer->isPlaying()) { - outputPlayer->pause(); - outputPlayerIsPaused = true; - - } else if (outputPlayerIsPaused) { - outputPlayer->start(); - outputPlayerIsPaused = false; - } -} - - -/*------------------------------------------------------------------------------ - * Stop the output audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: stopOutputAudio(void) - throw (std::logic_error) -{ - if (outputItemPlayingNow) { - outputPlayerIsPaused = false; - outputItemPlayingNow.reset(); - - Ptr::Ref nullPointer; - setNowPlaying(nullPointer); - - outputPlayer->close(); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the "output audio player has stopped" event. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: onStop(Ptr::Ref errorMessage) - throw () -{ - outputItemPlayingNow.reset(); - try { - outputPlayer->close(); - - Ptr::Ref playable = masterPanel->getNextItemToPlay(); - setNowPlaying(playable); - if (playable) { - playOutputAudio(playable); - } - } catch (std::logic_error) { - std::cerr << "logic_error caught in GLiveSupport::onStop()\n"; - std::exit(1); - } - - if (errorMessage) { - displayMessageWindow(*errorMessage); - } -} - -/*------------------------------------------------------------------------------ - * Event handler for the "output audio player has started" event. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: onStart(gint64 id) - throw () -{ - masterPanel->setCurrentInnerPlayable(id); -} - - -/*------------------------------------------------------------------------------ - * Play a Playable object using the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: playCueAudio(Ptr::Ref playable) - throw (std::logic_error, - std::runtime_error) -{ - if (cueItemPlayingNow) { - stopCueAudio(); // stop the audio player and - } // release old resources - - try { - switch (playable->getType()) { - case Playable::AudioClipType: - cueItemPlayingNow = acquireAudioClip(playable->getId()); - cuePlayer->open(*cueItemPlayingNow->getUri(), (gint64)cueItemPlayingNow->getId()->getId(), 0L); - cuePlayer->start(); - std::cerr << "gLiveSupport: Cue playing audio clip '" - << *playable->getTitle() - << "'" << std::endl; - break; - - case Playable::PlaylistType: - cueItemPlayingNow = acquirePlaylist(playable->getId()); - cuePlayer->open(*cueItemPlayingNow->getUri(), (gint64)cueItemPlayingNow->getId()->getId(), 0L); - cuePlayer->start(); - std::cerr << "gLiveSupport: Cue playing playlist '" - << *playable->getTitle() - << "'" << std::endl; - break; - - default: // this never happens - break; - } - } catch (XmlRpcException &e) { - Ptr::Ref eMsg - = getResourceUstring("audioErrorMsg"); - eMsg->append("\n"); - eMsg->append(e.what()); - displayMessageWindow(*eMsg); - throw std::runtime_error(e.what()); - } catch (std::invalid_argument &e) { - Ptr::Ref eMsg - = getResourceUstring("audioErrorMsg"); - eMsg->append("\n"); - eMsg->append(e.what()); - displayMessageWindow(*eMsg); - throw std::runtime_error(e.what()); - } catch (std::runtime_error &e) { - Ptr::Ref eMsg - = getResourceUstring("audioErrorMsg"); - eMsg->append("\n"); - eMsg->append(e.what()); - displayMessageWindow(*eMsg); - throw std::runtime_error(e.what()); - } - - cuePlayerIsPaused = false; -} - - -/*------------------------------------------------------------------------------ - * Pause the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: pauseCueAudio(void) - throw (std::logic_error) -{ - if (!cuePlayerIsPaused && cuePlayer->isPlaying()) { - cuePlayer->pause(); - cuePlayerIsPaused = true; - - } else if (cuePlayerIsPaused) { - cuePlayer->start(); - cuePlayerIsPaused = false; - } -} - - -/*------------------------------------------------------------------------------ - * Stop the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: stopCueAudio(void) - throw (std::logic_error) -{ - if (cueItemPlayingNow) { - cuePlayer->close(); - cuePlayerIsPaused = false; - cueItemPlayingNow.reset(); - - // test needed: this gets called indirectly from ~MasterPanelWindow - if (masterPanel) { - masterPanel->showCuePlayerStopped(); - } - } -} - - -/*------------------------------------------------------------------------------ - * Attach a listener for the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: attachCueAudioListener(AudioPlayerEventListener * listener) - throw () -{ - cuePlayer->attachListener(listener); -} - - -/*------------------------------------------------------------------------------ - * Detach the listener for the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: detachCueAudioListener(AudioPlayerEventListener * listener) - throw (std::invalid_argument) -{ - cuePlayer->detachListener(listener); -} - - -/*------------------------------------------------------------------------------ - * Return an image containing the radio station logo. - *----------------------------------------------------------------------------*/ -Glib::RefPtr -LiveSupport :: GLiveSupport :: -GLiveSupport :: getStationLogoPixbuf(void) throw() -{ - return stationLogoPixbuf; -} - - -/*------------------------------------------------------------------------------ - * Get the localized name of the keyboard shortcut action. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: getLocalizedKeyboardActionName( - Ptr::Ref actionName) - throw (std::invalid_argument) -{ - return getResourceUstring("keyboardShortcuts", actionName->c_str()); -} - - -/*------------------------------------------------------------------------------ - * Get the localized name of the window. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveSupport :: GLiveSupport :: -GLiveSupport :: getLocalizedWindowName( - Ptr::Ref windowName) - throw (std::invalid_argument) -{ - return getResourceUstring(windowName->c_str(), "windowTitle"); -} - - -/*------------------------------------------------------------------------------ - * Save the position and size of the window. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: putWindowPosition(const GuiWindow * window) - throw () -{ - WindowPositionType pos; - window->getWindow()->get_position(pos.x, pos.y); - window->getWindow()->get_size(pos.width, pos.height); - - windowPositions[replaceSpaces(window->getTitle())] = pos; -} - - -/*------------------------------------------------------------------------------ - * Apply saved position and size data to the window. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: getWindowPosition(GuiWindow * window) - throw () -{ - WindowPositionsListType::const_iterator it = windowPositions.find( - replaceSpaces(window->getTitle())); - if (it != windowPositions.end()) { - WindowPositionType pos = it->second; - window->getWindow()->move(pos.x, pos.y); - window->getWindow()->resize(pos.width, pos.height); - } -} - - -/*------------------------------------------------------------------------------ - * Replace spaces with underscore characters. - *----------------------------------------------------------------------------*/ -Glib::ustring -LiveSupport :: GLiveSupport :: -GLiveSupport :: replaceSpaces(Ptr::Ref string) - throw () -{ - Glib::ustring copy = *string; - - for (unsigned int i = 0; i < copy.size(); ++i) { - if (copy[i] == ' ') { - copy.replace(i, 1, 1, '_'); - } - } - - return copy; -} - - -/*------------------------------------------------------------------------------ - * Store the saved window positions. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: storeWindowPositions(void) throw () -{ - // just store this as a space-delimited list of window names and numbers - std::ostringstream prefsString; - WindowPositionsListType::iterator it; - WindowPositionsListType::iterator end; - WindowPositionType pos; - - it = windowPositions.begin(); - end = windowPositions.end(); - while (it != end) { - prefsString << it->first << " "; - pos = it->second; - prefsString << pos.x << " " - << pos.y << " " - << pos.width << " " - << pos.height << " "; - ++it; - } - - Ptr::Ref prefsUstring(new Glib::ustring(prefsString.str())); - try { - authentication->savePreferencesItem(sessionId, - windowPositionsKey, - prefsUstring); - } catch (XmlRpcException &e) { - // TODO: signal error - std::cerr << "error saving user preferences: " << e.what() << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Load the window positions. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: loadWindowPositions(void) throw () -{ - Ptr::Ref prefsUstring; - - try { - prefsUstring = authentication->loadPreferencesItem(sessionId, - windowPositionsKey); - } catch (XmlRpcException &e) { - // TODO: signal error - std::cerr << "error loading user preferences: " << e.what() - << std::endl; - return; - } catch (std::invalid_argument &e) { - // no window positions were stored for this user yet; no problem - return; - } - - // load the prefs, which is a space-delimited list - std::istringstream prefsString(prefsUstring->raw()); - - while (!prefsString.eof()) { - Glib::ustring windowName; - prefsString >> windowName; - if (prefsString.fail()) { - break; - } - - WindowPositionType pos; - prefsString >> pos.x; - if (prefsString.fail()) { - continue; - } - prefsString >> pos.y; - if (prefsString.fail()) { - continue; - } - prefsString >> pos.width; - if (prefsString.fail()) { - continue; - } - prefsString >> pos.height; - if (prefsString.fail()) { - continue; - } - - windowPositions[windowName] = pos; - } -} - - -/*------------------------------------------------------------------------------ - * Set the device for the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: setCueAudioDevice(Ptr::Ref deviceName) - throw () -{ - cuePlayer->setAudioDevice(*deviceName); -} - - -/*------------------------------------------------------------------------------ - * Play a test sound on the cue audio player. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: playTestSoundOnCue(Ptr::Ref oldDevice, - Ptr::Ref newDevice) - throw () -{ - if (cueItemPlayingNow) { - stopCueAudio(); // stop the audio player and - } // release old resources - - try { - if (cuePlayer->isOpen()) { - if (cuePlayer->isPlaying()) { - cuePlayer->stop(); - } - cuePlayer->close(); - } - cuePlayer->setAudioDevice(*newDevice); - cuePlayer->open(*testAudioUrl, 0L, 0L); - cuePlayer->start(); - Ptr::Ref sleepT(new time_duration(microseconds(10))); - while (cuePlayer->isPlaying()) { - runMainLoop(); - TimeConversion::sleep(sleepT); - } - } catch (std::runtime_error &e) { - // "invalid device" error from open(); do nothing - } catch (std::logic_error &e) { - // some other error; do nothing - } - cuePlayer->close(); - cuePlayer->setAudioDevice(*oldDevice); -} - - -/*------------------------------------------------------------------------------ - * Check if the scheduler is available. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: checkSchedulerClient(void) throw () -{ - try { - scheduler->getVersion(); - schedulerAvailable = true; - if (masterPanel) { - masterPanel->setSchedulerAvailable(true); - } - } catch (XmlRpcException &e) { - schedulerAvailable = false; - if (masterPanel) { - masterPanel->setSchedulerAvailable(false); - } - } -} - - -/*------------------------------------------------------------------------------ - * Start the scheduler daemon. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: startSchedulerClient(void) throw () -{ - system(schedulerDaemonStartCommand->c_str()); -} - - -/*------------------------------------------------------------------------------ - * Stop the scheduler daemon. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: stopSchedulerClient(void) throw () -{ - system(schedulerDaemonStopCommand->c_str()); -} - - -/*------------------------------------------------------------------------------ - * Upload a Playable object to the network hub. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: uploadToHub(Ptr::Ref playable) - throw () -{ - masterPanel->uploadToHub(playable); -} - - -/*------------------------------------------------------------------------------ - * Display a message that the authentication server is not available. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: displayAuthenticationServerMissingMessage(void) throw () -{ - // "authentication not available -- would you like to edit the options?" - Gtk::ResponseType answer = runNoYesDialog(*getResourceUstring( - "authenticationNotReachableMsg")); - - if (answer == Gtk::RESPONSE_YES) { -/* DISABLED TEMPORARILY - Ptr::Ref optionsWindow(new OptionsWindow( - shared_from_this(), - getBundle("optionsWindow"), - 0, - gladeDir)); - optionsWindow->run(); - - if (optionsContainer->isTouched()) { - optionsContainer->writeToFile(); - } -*/ - } -} - - -/*------------------------------------------------------------------------------ - * Refresh the playlist in the Live Mode window. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: refreshPlaylistInLiveMode(Ptr::Ref playlist) - throw () -{ - masterPanel->refreshPlaylistInLiveMode(playlist); -} - - -/*------------------------------------------------------------------------------ - * Preload the Scratchpad window during login. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: createScratchpadWindow(void) - throw () -{ - if (masterPanel) { - masterPanel->createScratchpadWindow(); - } -} - - -/*------------------------------------------------------------------------------ - * Write a string to the serial device. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: writeToSerial(Ptr::Ref message) - throw () -{ - Ptr::Ref - serialDevice = optionsContainer->getOptionItem( - OptionsContainer::serialDeviceName); - try { - // TODO: move this to a separate class, and make it configurable - serialStream->Open(*serialDevice); - serialStream->SetBaudRate(LibSerial::SerialStreamBuf::BAUD_2400); - serialStream->SetCharSize(LibSerial::SerialStreamBuf::CHAR_SIZE_8); - serialStream->SetNumOfStopBits(1); - serialStream->SetParity(LibSerial::SerialStreamBuf::PARITY_NONE); - serialStream->SetFlowControl( - LibSerial::SerialStreamBuf::FLOW_CONTROL_NONE); - (*serialStream) << *message; - serialStream->flush(); - serialStream->Close(); - } catch (...) { - // TODO: handle this somehow - std::cerr << "IO error in GLiveSupport::writeToSerial()" << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Replace the placeholders in the RDS settings with the current values. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: substituteRdsData(Ptr::Ref rdsString) - throw () -{ - Ptr::Ref playable = masterPanel->getCurrentInnerPlayable(); - - // these substitutions are documented in the doxygen docs of the - // public updateRds() function - substituteRdsItem(rdsString, "%c", playable, "dc:creator"); - substituteRdsItem(rdsString, "%t", playable, "dc:title"); - substituteRdsItem(rdsString, "%d", playable, "dc:format:extent"); - substituteRdsItem(rdsString, "%s", playable, "dc:source"); - substituteRdsItem(rdsString, "%y", playable, "ls:year"); -} - - -/*------------------------------------------------------------------------------ - * Replace a single placeholders in the RDS settings. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: substituteRdsItem(Ptr::Ref rdsString, - const std::string & placeholder, - Ptr::Ref playable, - const std::string & metadataKey) - throw () -{ - size_t pos; - while ((pos = rdsString->find(placeholder)) != std::string::npos) { - Ptr::Ref value; - if (playable) { - value = playable->getMetadata(metadataKey); - } - if (!value) { - value.reset(new Glib::ustring("")); - } - rdsString->replace(pos, placeholder.length(), *value); - } -} - - -/*------------------------------------------------------------------------------ - * Read the RDS settings, and send them to the serial port. - *----------------------------------------------------------------------------*/ -void -LiveSupport :: GLiveSupport :: -GLiveSupport :: updateRds(void) throw () -{ - Ptr::Ref - rdsString = optionsContainer->getCompleteRdsString(); - if (rdsString) { - substituteRdsData(rdsString); - writeToSerial(rdsString); - } -} - diff --git a/src/products/gLiveSupport/src/GLiveSupport.h b/src/products/gLiveSupport/src/GLiveSupport.h deleted file mode 100644 index 8779aff39..000000000 --- a/src/products/gLiveSupport/src/GLiveSupport.h +++ /dev/null @@ -1,1429 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GLiveSupport_h -#define GLiveSupport_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/LocalizedConfigurable.h" -#include "LiveSupport/Core/MetadataTypeContainer.h" -#include "LiveSupport/Core/OptionsContainer.h" -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/SchedulerClient/SchedulerClientInterface.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "LiveSupport/Widgets/WidgetFactory.h" -#include "KeyboardShortcutList.h" -#include "TaskbarIcons.h" -#include "ContentsStorable.h" -#include "GuiWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::SchedulerClient; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::Widgets; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - - -class MasterPanelWindow; - - -/** - * The main application object for the gLiveSupport GUI. - * - * The configuration file for this object is based on configuration - * elements used by the object. The DTD for the root element of the - * configuration file is: - * - *

- *  
- *  
- * - * These elements configure objects of the same name, except for - * outputPlayer and cuePlayer, which configure two instances of - * AudioPlayerFactory; and stationLogo, which is just a path to the - * station logo image file. - * - * @see LocalizedObject#getBundle(const xmlpp::Element &) - * @see AuthenticationClientFactory - * @see StorageClientFactory - * @see SchedulerClientFactory - */ -class GLiveSupport : public LocalizedConfigurable, - public boost::enable_shared_from_this, - public AudioPlayerEventListener -{ - public: - - /** - * A type for the map of supported languages. - * This is an STL map, containing const Glib::ustring as keys, which - * are the language name of supported langauges. The values are - * const std::string, the names of the locales for the languages. - */ - typedef std::map LanguageMap; - - /** - * A type for having a map of AudioClip objects, with using - * the ids of the objects as keys. - */ - typedef std::map::Ref> AudioClipMap; - - /** - * A type for having a map of Playlist objects, with using - * the ids of the objects as keys. - */ - typedef std::map::Ref> PlaylistMap; - - - private: - - /** - * The name of the configuration XML elmenent used by this class. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The authentication client used by the application. - */ - Ptr::Ref authentication; - - /** - * The storage client used by the application. - */ - Ptr::Ref storage; - - /** - * The directory where the Glade files are. - */ - Glib::ustring gladeDir; - - /** - * The Glade object, containing the visual design. - * For this class, it only contains some pop-up windows. - */ - Glib::RefPtr glade; - - /** - * The widget factory, containing our own widgets. - */ - Ptr::Ref widgetFactory; - - /** - * The scheduler client, used to access the scheduler daemon. - */ - Ptr::Ref scheduler; - - /** - * The output audio player. - */ - Ptr::Ref outputPlayer; - - /** - * The cue audio player. - */ - Ptr::Ref cuePlayer; - - /** - * The user id for the logged-in user. - */ - Ptr::Ref userName; - - /** - * The session id for the logged-in user. - */ - Ptr::Ref sessionId; - - /** - * The map of supported languages. - */ - Ptr::Ref supportedLanguages; - - /** - * The container for all the possible metadata types. - */ - Ptr::Ref metadataTypeContainer; - - /** - * The master panel window. - */ - Ptr::Ref masterPanel; - - /** - * A map, holding references to all AudioClip objects that are - * opened. - */ - Ptr::Ref openedAudioClips; - - /** - * A map, holding references to all Playlist objects that are - * opened. - */ - Ptr::Ref openedPlaylists; - - /** - * The one and only playlist that may be edited at any one time. - */ - Ptr::Ref editedPlaylist; - - /** - * The playlist or audio clip that is being played on the - * live mode output sound card (may be null). - */ - Ptr::Ref outputItemPlayingNow; - - /** - * The playlist or audio clip that is being played on the - * cue (preview) sound card (may be null). - */ - Ptr::Ref cueItemPlayingNow; - - /** - * True if the output audio player has been paused. - */ - bool outputPlayerIsPaused; - - /** - * True if the cue audio player has been paused. - */ - bool cuePlayerIsPaused; - - /** - * The raw image containing the station logo. - */ - Glib::RefPtr stationLogoPixbuf; - - /** - * The wrapper class containing the taskbar icon images. - */ - Ptr::Ref taskbarIcons; - - /** - * The location of the test audio file. - */ - Ptr::Ref testAudioUrl; - - /** - * The command which starts the scheduler daemon. - */ - Ptr::Ref schedulerDaemonStartCommand; - - /** - * The command which stops the scheduler daemon. - */ - Ptr::Ref schedulerDaemonStopCommand; - - /** - * The serial stream object. - */ - Ptr::Ref serialStream; - - /** - * Read a supportedLanguages configuration element, - * and fill the supportedLanguages map with its contents. - * - * @param element a supportedLanguages element - * @exception std::invalid_argument if the supplied XML element - * is wrong - */ - void - configSupportedLanguages(const xmlpp::Element & element) - throw (std::invalid_argument); - - /** - * Emit the "edited playlist has been modified" signal. - */ - void - emitSignalEditedPlaylistModified(void) throw () - { - signalEditedPlaylistModified().emit(); - } - - /** - * Remove a playlist from the playlist cache. - * The playlist will be released, if it has been acquired earlier. - * If the playlist wasn't in the cache, nothing happens. - * - * @param id the id of the playlist to remove. - */ - void - uncachePlaylist(Ptr::Ref id) - throw (XmlRpcException); - - /** - * The list of keyboard shortcuts for the various windows. - */ - Ptr::Ref keyboardShortcutList; - - /** - * The type for a single window position. - */ - typedef struct { - int x; - int y; - int width; - int height; - } WindowPositionType; - /** - * The type for storing the window positions. - */ - typedef std::map - WindowPositionsListType; - - /** - * The positions of the various windows. - */ - WindowPositionsListType windowPositions; - - /** - * An object containing the contents of the options file. - */ - Ptr::Ref optionsContainer; - - /** - * Whether the storage component is available. - */ - bool storageAvailable; - - /** - * Whether the scheduler component is available. - */ - bool schedulerAvailable; - - /** - * Private constructor. - */ - GLiveSupport(void) throw () - : outputPlayerIsPaused(false), - cuePlayerIsPaused(false) - { - openedAudioClips.reset(new AudioClipMap()); - openedPlaylists.reset(new PlaylistMap()); - serialStream.reset(new LibSerial::SerialStream()); - } - - /** - * Display a message that the authentication server is not available. - * And offer a chance to edit the options to fix it. - */ - void - displayAuthenticationServerMissingMessage(void) throw (); - - /** - * Refresh the playlist in the Live Mode window. - * Updates the playlist to the new copy supplied in the argument, - * if it is present in the Live Mode window. - * This is called by savePlaylist() after the playlist has been - * edited. - * - * @param playlist the new version of the playlist. - */ - void - refreshPlaylistInLiveMode(Ptr::Ref playlist) - throw (); - - /** - * Replace the placeholders in the RDS settings with the - * current values. - * - * @param rdsString the string with the placeholders; - * they will be replaced in place. - */ - void - substituteRdsData(Ptr::Ref rdsString) - throw (); - - /** - * Replace a single placeholders in the RDS settings. - * If the corresponding metadata is not found, an empty string - * is substituted instead. - * - * @param rdsString the string with the placeholders; - * they will be replaced in place. - * @param placeholder the string to be substituted, e.g. "%t". - * @param playable the Playable object whose data is to be used. - * @param metadataKay the kind of metadata to be substituted. - */ - void - substituteRdsItem(Ptr::Ref rdsString, - const std::string & placeholder, - Ptr::Ref playable, - const std::string & metadataKey) - throw (); - - /** - * Write a string to the serial device. - */ - void - writeToSerial(Ptr::Ref message) throw (); - - /** - * Replace spaces with underscore characters. - * - * @param string the original string, eg: "one two three". - * @return the new string, eg: "one_two_three". - */ - Glib::ustring - replaceSpaces(Ptr::Ref string) throw (); - - /** - * Run a dialog window. - * - * @param dialogName the type of the dialog; can be "noYesDialog" - * or "okDialog". - * @param message the text to be displayed by the dialog. - * @return the response ID returned by the dialog. - */ - Gtk::ResponseType - runDialog(const Glib::ustring & dialogName, - const Glib::ustring & message) throw (); - - - protected: - - /** - * A signal object to notify people that the edited playlist changed. - */ - sigc::signal signalEditedPlaylistModifiedObject; - - - public: - - /** - * Virtual destructor. - */ - virtual - ~GLiveSupport(void) throw () - { - if (outputPlayer.get()) { - outputPlayer->deInitialize(); - } - if (cuePlayer.get()) { - cuePlayer->deInitialize(); - } - try { - releaseOpenedAudioClips(); - } catch (XmlRpcException &e) { - } - try { - releaseOpenedPlaylists(); - } catch(XmlRpcException &e) { - } - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the scheduler daemon based on the XML element - * supplied. - * - * @param element the XML element to configure the scheduler - * daemon from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured. - */ - void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * A function to check the configuration of this object. - * Checks all resources configured by configure() - * - * @retun true if all resources are accessible and working, - * false otherwise - */ - bool - checkConfiguration(void) throw (); - - /** - * Display a message window. - * This function only returns after the message window is closed. - * - * @param message the message to display - */ - void - displayMessageWindow(const Glib::ustring & message) - throw (); - - /** - * Run a dialog window with No and Yes buttons. - * - * @param message the text to be displayed by the dialog. - * @return the response ID returned by the dialog. - */ - Gtk::ResponseType - runNoYesDialog(const Glib::ustring & message) throw (); - - /** - * Run a dialog window with just an OK button. - * - * @param message the text to be displayed by the dialog. - * @return the response ID returned by the dialog. - */ - Gtk::ResponseType - runOkDialog(const Glib::ustring & message) throw (); - - /** - * Show the main window, and run the application. - * This call will only return after the main window has been closed. - */ - void - show(void) throw (); - - /** - * Change the language of the application. - * - * @param locale the new locale of the appliction. - * @exception std::invalid_argument if the specified locale is not - * available - */ - void - changeLanguage(Ptr::Ref locale) - throw (std::invalid_argument); - - /** - * Perform authentication for the user of the application. - * As a result, the user will be authenticated for later - * actions, that need authentication. - * The user has to be logged out later. - * - * @param login the login ID of the user - * @param password the password of the user - * @return true if the authentication was successful, - * false otherwise - * @see #logout - */ - bool - login(const std::string & login, - const std::string & password) throw (); - - /** - * Return the session id for the user. - * - * @return the session id for the user, if he has been already - * successfully authenticated with a call to login(), - * and not yet logged out. - * otherwise, a reference to 0. - * @see #login - */ - Ptr::Ref - getSessionId(void) const throw () - { - return sessionId; - } - - /** - * Log out the user, if he has been authenticated previously - * with a successful call to login(). - * - * @return true if the logout was successful, false if not - * (e.g., if the user is editing a playlist, and - * presses "cancel" at the "Save playlist?" dialog.) - * @see #logout - */ - bool - logout(void) throw (); - - /** - * Accessor function to the scheduler client held by this object. - * - * @return the scheduler client held by this object. - */ - Ptr::Ref - getScheduler(void) throw () - { - return scheduler; - } - - /** - * Get the map of supported languages. - * - * @return the map of supported languages. - */ - Ptr::Ref - getSupportedLanguages(void) const throw () - { - return supportedLanguages; - } - - /** - * Return a container with all supported metadata types. - * - * @return the metadata type container - */ - Ptr::Ref - getMetadataTypeContainer(void) const throw () - { - return metadataTypeContainer; - } - - /** - * Upload an audio clip to the storage. - * - * @param audioClip the audio clip to upload. - * @exception XmlRpcException on upload failures. - */ - void - uploadAudioClip(Ptr::Ref audioClip) - throw (XmlRpcException); - - /** - * Upload a playlist archive to the storage. - * - * @param path the path of the file to upload. - * @exception XmlRpcException on upload failures. - */ - Ptr::Ref - uploadPlaylistArchive(Ptr::Ref path) - throw (XmlRpcException); - - /** - * Add an item to the Scratchpad, and update it. - * If the item is already in the scratchpad, it gets pushed to the top. - * - * @param playable the audio clip or playlist to be added - */ - void - addToScratchpad(Ptr::Ref playable) - throw (XmlRpcException); - - /** - * Reset the storage behind GLiveSupport. - * Used for testing only. - * - * @exception XmlRpcException on communication problems. - */ - void - resetStorage(void) throw (XmlRpcException) - { - storage->reset(); - } - - /** - * Tell if an audio clip specified by an id exists. - * - * @param id the id of the audio clip to check for. - * @return true if the audio clip by the specified id exists, - * false otherwise. - * @exception XmlRpcException on communication problems. - */ - bool - existsAudioClip(Ptr::Ref id) throw (XmlRpcException) - { - return storage->existsAudioClip(sessionId, id); - } - - /** - * Open an audio clip, for reading only. - * The audio clip will be put into the internal cache of the - * GLiveSupport object. - * - * @param id the audio clip id. - * @return the audio clip opened. - * @exception XmlRpcException if no audio clip with the specified - * id exists, or there was a communication problem. - */ - Ptr::Ref - getAudioClip(Ptr::Ref id) - throw (XmlRpcException); - - /** - * Acquire an audio clip, for random file access. - * The audio clip will be put into the internal cache of the - * GLiveSupport object. - * - * @param id the audio clip id. - * @return the AudioClip acquired. - * note that the returned AudioClip does not have to be - * released, this will be done by the caching system - * automatically. - * @exception XmlRpcException if no audio clip with the specified - * id exists, or there was a communication problem. - */ - Ptr::Ref - acquireAudioClip(Ptr::Ref id) - throw (XmlRpcException); - - /** - * Tell if a playlist specified by an id exists. - * - * @param id the id of the playlist to check for. - * @return true if the playlist by the specified id exists, - * false otherwise. - * @exception XmlRpcException on communication problems. - */ - bool - existsPlaylist(Ptr::Ref id) throw (XmlRpcException) - { - return storage->existsPlaylist(sessionId, id); - } - - /** - * Open a playlist, for reading only. - * The playlist will be put into the internal cache of the - * GLiveSupport object. - * - * @param id the playlist id. - * @return the playlist opened. - * @exception XmlRpcException if no playlist with the specified - * id exists, or there was a communication problem. - */ - Ptr::Ref - getPlaylist(Ptr::Ref id) - throw (XmlRpcException); - - /** - * Acquire a playlist, for random file access. - * The playlist will be put into the internal cache of the - * GLiveSupport object. - * - * @param id the playlist id. - * @return the playlist acquired. - * note that the returned Playlist does not have to be - * released, this will be done by the caching system - * automatically. - * @exception XmlRpcException if no playlist with the specified - * id exists, or there was a communication problem. - */ - Ptr::Ref - acquirePlaylist(Ptr::Ref id) - throw (XmlRpcException); - - /** - * Tell if a playable object specified by an id exists. - * - * @param id the id of the playable to check for. - * @return true if the playable by the specified id exists, - * false otherwise. - * @exception XmlRpcException on communication problems. - */ - bool - existsPlayable(Ptr::Ref id) throw (XmlRpcException) - { - return storage->existsAudioClip(sessionId, id) - || storage->existsPlaylist(sessionId, id); - } - - /** - * Open a playable object, for reading only. - * Calls either getAudioClip() or getPlaylist(). - * You do not need to release the returned Playable object. - * - * @param id the id of the playable object. - * @return the playable object opened. - * @exception XmlRpcException if no Playable with the specified - * id exists, or there was a communication problem. - */ - Ptr::Ref - getPlayable(Ptr::Ref id) - throw (XmlRpcException); - - /** - * Acquire a playable object. - * Calls either acquireAudioClip() or acquirePlaylist(). - * - * @param id the id of the playable object. - * @return the playable object acquired. - * note that the returned Playable does not have to be - * released, this will be done by the caching system - * automatically. - * @exception XmlRpcException if no Playable with the specified - * id exists, or there was a communication problem. - */ - Ptr::Ref - acquirePlayable(Ptr::Ref id) - throw (XmlRpcException); - - /** - * Release all opened audio clips. - */ - void - releaseOpenedAudioClips(void) throw (XmlRpcException); - - /** - * Release all opened playlists. - */ - void - releaseOpenedPlaylists(void) throw (XmlRpcException); - - /** - * Add a file to the Live Mode, and update it. - * - * @param playable the audio clip or playlist to be added - */ - void - addToLiveMode(Ptr::Ref playable) throw (); - - /** - * Return the currently edited playlist. - * - * @return the currenlty edited playlist, or a reference to 0 - * if no playlist is edited - */ - Ptr::Ref - getEditedPlaylist(void) throw () - { - return editedPlaylist; - } - - /** - * Create a new playlist or Open a playlist for editing. - * The opened playlist can be later accessed by getEditedPlaylist(). - * Always release the opened playlist by calling - * releaseEditedPlaylist(). - * - * If the argument is 0, a new playlist is created in the storage. - * - * After a call to this function, getEditedPlaylist() is guaranteed - * to return a non-0 value. - * - * If there is a playlist being edited, the - * PlaylistWindow's confirmation message is displayed. - * If the user presses "Cancel", then this function does nothing. - * - * @param playlistId the id of the playlist to open for editing. - * if a reference to 0, create a new playlist. - * @return the new playlist object, which is opened for editing. - * @exception XmlRpcException on XMl-RPC errors. - * @see #getEditedPlaylist - * @see #releaseEditedPlaylist - */ - void - openPlaylistForEditing( - Ptr::Ref playlistId - = Ptr::Ref()) - throw (XmlRpcException); - - /** - * Add a playable item to the currently open playlist. - * If there is no currently open playlist, open the simple playlist - * management window with a new playlist, holding only this one - * entry. - * Always release the opened playlist by calling - * releaseEditedPlaylist() - * - * @param id the id of the playable object to add to the playlist. - * @exception XmlRpcException on XMl-RPC errors. - * @see #releaseEditedPlaylist - */ - void - addToPlaylist(Ptr::Ref id) - throw (XmlRpcException); - /** - * Save the currently edited playlist in storage. - * This call has to be preceeded by a call to openPlaylistForEditing() - * or addToPlaylist(). - * After this call, the playlist is no longer being edited. If you - * want to continue editing, open the playlist for editing again. - * - * @exception XmlRpcException on upload failures. - * @see #openPlaylistForEditing - * @see #addToPlaylist - */ - void - savePlaylist(void) throw (XmlRpcException); - - /** - * Cancel the edited playlist: undo changes and release the lock. - * - * @exception XmlRpcException on XML-RPC errors. - * @see #openPlaylistForEditing - */ - void - cancelEditedPlaylist(void) throw (XmlRpcException); - - /** - * Return the scheduled entries for a specified time interval. - * - * @param from the start of the interval, inclusive - * @param to the end of the interval, exclusive - * @return a vector of the schedule entries for the time period. - * @exception XmlRpcException in case of XML-RPC errors. - */ - virtual Ptr::Ref> >::Ref - displaySchedule(Ptr::Ref from, - Ptr::Ref to) - throw (XmlRpcException) - { -std::cout << "calling GLiveSupport :: displaySchedule !!!!!!!!!!!!!!!!!" << std::endl; - return scheduler->displaySchedule(sessionId, from, to); - } - - /** - * Schedule a playlist. - * This will schedule the plalyist, and show the scheduler window - * at the time of the scheduled playlist. - * - * @param playlist the playlist to schedule. - * @param playtime the time for when to schedule. - * @exception XmlRpcException in case of XML-RPC errors. - */ - virtual void - schedulePlaylist(Ptr::Ref playlist, - Ptr::Ref playtime) - throw (XmlRpcException); - - - /** - * Remove a scheduled item. - * - * @param sessionId a valid, authenticated session id. - * @param scheduledEntryId the id of the scheduled entry to remove. - * @exception XmlRpcException in case of XML-RPC errors. - */ - virtual void - removeFromSchedule(Ptr::Ref scheduleEntryId) - throw (XmlRpcException); - - /** - * Preload the item in the output audio player. - * This is to shorten the time a playlist takes to start. - * - * @param playable the Playable object to be preloaded. - */ - void - preload(Ptr::Ref playable) - throw (); - - /** - * Play a Playable object using the output audio player. - * - * @param playable the Playable object to play. - * @exception std::logic_error in case of audio player errors. - * @exception std::runtime_error in case of audio player errors. - */ - virtual bool - playOutputAudio(Ptr::Ref playable) - throw (std::logic_error, - std::runtime_error); - - /** - * Stop the output audio player. - * - * @exception std::logic_error in case of audio player errors. - */ - virtual void - stopOutputAudio(void) - throw (std::logic_error); - - /** - * Pause the output audio player. - * - * @exception std::logic_error in case of audio player errors. - */ - virtual void - pauseOutputAudio(void) - throw (std::logic_error); - - /** - * Determine the time elapsed in the current Playable object - * played by the output audio player. - * - * @return the current time position in the currently open - * Playable object. - * @exception std::logic_error if there is no Playable object open. - */ - virtual Ptr::Ref - getOutputAudioPosition(void) - throw (std::logic_error) - { - return outputPlayer->getPosition(); - } - - /** - * Play a Playable object using the cue audio player. - * - * @param playable the Playable object to play. - * @exception std::logic_error in case of audio player errors. - * @exception std::runtime_error in case of audio player errors. - */ - virtual void - playCueAudio(Ptr::Ref playable) - throw (std::logic_error, - std::runtime_error); - - /** - * Stop the cue audio player. - * - * @exception XmlRpcException in case of storage server errors. - * @exception std::logic_error in case of audio player errors. - */ - virtual void - stopCueAudio(void) - throw (std::logic_error); - - /** - * Pause the cue audio player. - * - * @exception std::logic_error in case of audio player errors. - */ - virtual void - pauseCueAudio(void) - throw (std::logic_error); - - /** - * Attach a listener for the cue audio player (the listener - * will be notified when the cue audio player has stopped playing). - * - * @param listener the event listener to register. - */ - void - attachCueAudioListener(AudioPlayerEventListener * listener) - throw (); - - /** - * Detach the listener for the cue audio player. - * - * @param listener the event listener to unregister. - * @exception std::invalid_argument if the supplied event listener - * has not been previously registered. - */ - void - detachCueAudioListener(AudioPlayerEventListener * listener) - throw (std::invalid_argument); - - /** - * Set the device for the cue audio player. - * - * @param deviceName the name of the new device - */ - void - setCueAudioDevice(Ptr::Ref deviceName) - throw (); - - /** - * Play a test sound on the cue audio player. - * - * @param oldDevice the name of the current audio device. - * @param oldDevice the name of the audio device to be tested. - */ - void - playTestSoundOnCue(Ptr::Ref oldDevice, - Ptr::Ref newDevice) - throw (); - - /** - * Search in the local storage. - * Note that the return value (number of items found) will not be - * the same as the size of getSearchResults() if the limit and offset - * fields in the criteria parameter are not zero. - * - * @param criteria the search conditions to use. - * @return the number of audio clips and playlists found. - * @exception XmlRpcException thrown by - * StorageClientInterface::search() - */ - int - search(Ptr::Ref criteria) - throw (XmlRpcException); - - /** - * Event handler for the "output audio player has stopped" event. - * - * @param errorMessage is a 0 pointer if the player stopped normally - */ - virtual void - onStop(Ptr::Ref errorMessage - = Ptr::Ref()) - throw (); - - /** - * Event handler for the "output audio player has started" event. - * - * @param fileName - */ - virtual void - onStart(gint64 id) - throw (); - - /** - * Display the playable item on the master panel as "now playing". - */ - void - setNowPlaying(Ptr::Ref playable) - throw (); - - /** - * Return a pixbuf containing the radio station logo. - * - * @return a pixbuf containing the station logo image. - */ - Glib::RefPtr - getStationLogoPixbuf() throw (); - - /** - * The signal raised when the edited playlist is modified. - * - * @return the signal object (a protected member of this class) - */ - sigc::signal - signalEditedPlaylistModified(void) throw () - { - return signalEditedPlaylistModifiedObject; - } - - /** - * Find the action triggered by the given key in the given window. - * - * @param windowName a string identifying the window (not localized). - * @param modifiers the gdktypes code for the Shift, Ctrl etc. - * modifier keys which are pressed. - * @param key the gdkkeysyms code for the key pressed. - * @return the associated action; or noAction, if none is found. - */ - KeyboardShortcut::Action - findAction(const Glib::ustring & windowName, - Gdk::ModifierType modifiers, - guint key) const throw () - { - return keyboardShortcutList->findAction(windowName, modifiers, key); - } - - /** - * The list of all KeyboardShortcutContainer objects. - * Used in the Key bindings section of the OptionsWindow class. - * - * @return a const pointer to the list (implemented as a std::map). - */ - Ptr::Ref - getKeyboardShortcutList(void) throw () - { - return keyboardShortcutList; - } - - /** - * Get the localized name of the window. - * Used in the Key bindings section of the OptionsWindow class. - * - * @param windowName the name of the window. - * @return the localized name. - * @exception std::invalid_argument if the resource bundle is - * not found - */ - Ptr::Ref - getLocalizedWindowName(Ptr::Ref windowName) - throw (std::invalid_argument); - - /** - * Get the localized name of the keyboard shortcut action. - * Used in the Key bindings section of the OptionsWindow class. - * - * @param actionName the name of the action. - * @return the localized name. - * @exception std::invalid_argument if the resource bundle is - * not found - * @see KeyboardShortcut::getActionString() - */ - Ptr::Ref - getLocalizedKeyboardActionName( - Ptr::Ref actionName) - throw (std::invalid_argument); - - /** - * Save the position and size of the window. - * - * The coordinates of the window's North-West corner and the - * size of the window are read, and stored in a variable of the - * GLiveSupport object, indexed by the window's get_name(). - * - * @param window the window to save the position and size of. - * @see getWindowPosition() - */ - void - putWindowPosition(const GuiWindow * window) throw (); - - /** - * Apply saved position and size data to the window. - * - * If position and size data were previously saved for a window - * with the same get_name(), then these data are read and applied to - * the window, restoring its position and size. - * - * @param window the window to apply the position and size info to. - * @see putWindowPosition() - */ - void - getWindowPosition(GuiWindow * window) throw (); - - /** - * Store the saved window positions. - * - * The window positions (and sizes) are stored in a user preference - * item. This is called when the user logs out. - * - * @see loadWindowPositions() - */ - void - storeWindowPositions(void) throw (); - - /** - * Load the window positions. - * - * The window positions (and sizes) are retrieved from the user - * preference item they were stored in. This is called when the - * user logs in. - * - * @see storeWindowPosition() - */ - void - loadWindowPositions(void) throw (); - - /** - * Access the OptionsContainer object containing the options. - */ - Ptr::Ref - getOptionsContainer(void) throw() - { - return optionsContainer; - } - - /** - * Store the contents of a window as a user preference. - * - * @param window the window to get the contents of. - */ - void - storeWindowContents(Ptr::Ref window) - throw () - { - storeWindowContents(window.get()); - } - - /** - * Load the contents of a window as a user preference. - * - * @param window the window to restore the contents of. - */ - void - loadWindowContents(Ptr::Ref window) - throw () - { - loadWindowContents(window.get()); - } - - /** - * Store the contents of a window as a user preference. - * - * @param window the window to get the contents of. - */ - void - storeWindowContents(ContentsStorable * window) throw (); - - /** - * Load the contents of a window as a user preference. - * - * @param window the window to restore the contents of. - */ - void - loadWindowContents(ContentsStorable * window) throw (); - - /** - * Return whether the storage component is available. - */ - bool - isStorageAvailable(void) throw() - { - return storageAvailable; - } - - /** - * Return whether the scheduler component is available. - */ - bool - isSchedulerAvailable(void) throw() - { - return schedulerAvailable; - } - - /** - * Access the StorageClientInterface object. - */ - Ptr::Ref - getStorageClient(void) throw() - { - return storage; - } - - /** - * Check if the scheduler is available. - * This updates the schedulerAvailable variable accordingly. - */ - void - checkSchedulerClient(void) throw(); - - /** - * Start the scheduler client. - */ - void - startSchedulerClient(void) throw(); - - /** - * Stop the scheduler client. - */ - void - stopSchedulerClient(void) throw(); - - /** - * Upload a Playable object to the network hub. - * - * This opens the Transports tab in the Search window, and adds the - * new upload task to it. - * - * @param playable the audio clip or playlist to be uploaded. - */ - void - uploadToHub(Ptr::Ref playable) throw (); - - /** - * Take a break. - * This will perform all pending redraws, by giving the control back - * to the main loop for a while. - * Call this occasionally in the middle of long computations, to - * make sure your window gets redrawn. - */ - void - runMainLoop(void) throw () - { - while (Gtk::Main::events_pending()) { - Gtk::Main::iteration(); - } - } - - /** - * Preload the Scratchpad window during login. - */ - void - createScratchpadWindow(void) throw (); - - /** - * Read the RDS settings, and send them to the serial port. - * - * The following RDS placeholders will be substituted: - * - *
    - *
  • "%c" ---> "dc:creator" (Creator)
  • - *
  • "%t" ---> "dc:title" (Title)
  • - *
  • "%d" ---> "dc:format:extent" (Duration)
  • - *
  • "%s" ---> "dc:source" (Album)
  • - *
  • "%y" ---> "ls:year" (Year)
  • - *
- * - * @see substituteRdsData() - */ - void - updateRds(void) throw (); - - /** - * Return the directory where the Glade files are. - * - * @return the directory where the Glade files are. - */ - Glib::ustring - getGladeDir(void) throw () - { - return gladeDir; - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // GLiveSupport_h - diff --git a/src/products/gLiveSupport/src/GLiveSupportTest.cxx b/src/products/gLiveSupport/src/GLiveSupportTest.cxx deleted file mode 100644 index 22702f0b6..000000000 --- a/src/products/gLiveSupport/src/GLiveSupportTest.cxx +++ /dev/null @@ -1,324 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_SYS_TYPES_H -#include -#else -#error "Need sys/types.h" -#endif - -#if HAVE_PWD_H -#include -#else -#error "Need pwd.h" -#endif - - -#include -#include -#include - -#include - -#include "LiveSupport/Core/TimeConversion.h" - -#include "GLiveSupportTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(GLiveSupportTest); - -namespace { - -/** - * The name of the generic configuration file for the GLiveSupport object. - */ -const std::string gLiveSupportEtcConfigFileName - = "etc/campcaster-studio.xml"; - -/** - * The name of the user-specific configuration file for the - * GLiveSupport object, relative to the user's home directory. - */ -const std::string gLiveSupportUserConfigFileName - = "/.campcaster/campcaster-studio.xml"; - -/** - * The login name. - */ -const std::string login = "root"; - -/** - * The password. - */ -const std::string password = "q"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Gtk::Main kit(0, 0); - - gLiveSupport = GLiveSupport::getInstance(); - - uid_t uid = getuid(); - struct passwd * pwd = getpwuid(uid); - std::string configFileName; - std::ifstream ifs; - - configFileName = pwd->pw_dir; - configFileName += gLiveSupportUserConfigFileName; - ifs.open(configFileName.c_str()); - if (!ifs.is_open() || ifs.bad()) { - ifs.close(); - ifs.clear(); - ifs.open(gLiveSupportEtcConfigFileName.c_str()); - } - - try { - Ptr::Ref parser(new xmlpp::DomParser()); - parser->parse_stream(ifs); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - - gLiveSupport->configure(*root); - - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in audio player configuration file: " - << e.what() << std::endl; - } catch (xmlpp::exception &e) { - std::cerr << "syntax error in audio player configuration file: " - << e.what() << std::endl; - } - ifs.close(); - - CPPUNIT_ASSERT_NO_THROW( - gLiveSupport->resetStorage(); - ); - - if (!gLiveSupport->login(login, password)) { - std::cerr << "gLiveSupport unable to log in" << std::endl; - } - - CPPUNIT_ASSERT_NO_THROW( - storage = gLiveSupport->getStorageClient(); - ); - CPPUNIT_ASSERT(storage); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: tearDown(void) throw () -{ - gLiveSupport->logout(); - - gLiveSupport.reset(); -} - - -/*------------------------------------------------------------------------------ - * Test to see if the audio player engine can be started and stopped - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref sessionId; - - sessionId = gLiveSupport->getSessionId(); - CPPUNIT_ASSERT(sessionId.get()); -} - - -/*------------------------------------------------------------------------------ - * Open an audio clip object. - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: openAudioClipTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref id; - Ptr::Ref clip; - - CPPUNIT_ASSERT(sampleData()->size() >= 7); - id = sampleData()->at(6)->getId(); - - try { - clip = gLiveSupport->getAudioClip(id); - CPPUNIT_ASSERT(clip.get()); - CPPUNIT_ASSERT(!clip->getToken().get()); - clip = gLiveSupport->getAudioClip(id); - CPPUNIT_ASSERT(clip.get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - gLiveSupport->releaseOpenedAudioClips(); - - try { - clip = gLiveSupport->getAudioClip(id); - CPPUNIT_ASSERT(clip.get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Acquire an audio clip object. - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: acquireAudioClipTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref id; - Ptr::Ref clip; - - CPPUNIT_ASSERT(sampleData()->size() >= 7); - id = sampleData()->at(6)->getId(); - - try { - clip = gLiveSupport->acquireAudioClip(id); - CPPUNIT_ASSERT(clip.get()); - CPPUNIT_ASSERT(clip->getToken().get()); - // for a subsequent open call, returned the acquired clip again - clip = gLiveSupport->getAudioClip(id); - CPPUNIT_ASSERT(clip.get()); - CPPUNIT_ASSERT(clip->getToken().get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - gLiveSupport->releaseOpenedAudioClips(); - - try { - clip = gLiveSupport->acquireAudioClip(id); - CPPUNIT_ASSERT(clip.get()); - CPPUNIT_ASSERT(clip->getToken().get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Open a playlist object. - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: openPlaylistTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref id; - Ptr::Ref playlist; - - CPPUNIT_ASSERT(sampleData()->size() >= 2); - id = sampleData()->at(1)->getId(); - - try { - playlist = gLiveSupport->getPlaylist(id); - CPPUNIT_ASSERT(playlist.get()); - CPPUNIT_ASSERT(!playlist->getUri().get()); - playlist = gLiveSupport->getPlaylist(id); - CPPUNIT_ASSERT(playlist.get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - gLiveSupport->releaseOpenedPlaylists(); - - try { - playlist = gLiveSupport->getPlaylist(id); - CPPUNIT_ASSERT(playlist.get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Acquire a playlist object. - *----------------------------------------------------------------------------*/ -void -GLiveSupportTest :: acquirePlaylistTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref id; - Ptr::Ref playlist; - - CPPUNIT_ASSERT(sampleData()->size() >= 2); - id = sampleData()->at(1)->getId(); - - try { - playlist = gLiveSupport->acquirePlaylist(id); - CPPUNIT_ASSERT(playlist.get()); - CPPUNIT_ASSERT(playlist->getUri().get()); - // for a subsequent open call, returned the acquired playlist again - playlist = gLiveSupport->getPlaylist(id); - CPPUNIT_ASSERT(playlist.get()); - CPPUNIT_ASSERT(playlist->getUri().get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } - - gLiveSupport->releaseOpenedPlaylists(); - - try { - playlist = gLiveSupport->acquirePlaylist(id); - CPPUNIT_ASSERT(playlist.get()); - CPPUNIT_ASSERT(playlist->getUri().get()); - } catch (XmlRpcException &e) { - CPPUNIT_FAIL(e.what()); - } -} - diff --git a/src/products/gLiveSupport/src/GLiveSupportTest.h b/src/products/gLiveSupport/src/GLiveSupportTest.h deleted file mode 100644 index d320e9d86..000000000 --- a/src/products/gLiveSupport/src/GLiveSupportTest.h +++ /dev/null @@ -1,170 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GLiveSupportTest_h -#define GLiveSupportTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Core/BaseTestMethod.h" - -#include "GLiveSupport.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Testing the GLiveSupport class - * - * @see GLiveSupport - */ -class GLiveSupportTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(GLiveSupportTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(openAudioClipTest); - CPPUNIT_TEST(acquireAudioClipTest); - CPPUNIT_TEST(openPlaylistTest); - CPPUNIT_TEST(acquirePlaylistTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The GLiveSupport object we're testing. - */ - Ptr::Ref gLiveSupport; - - /** - * The storage object we get from gLiveSupport. - */ - Ptr::Ref storage; - - /** - * Get the list of test Playable objects. - * This gets the result of the latest "local search", which in - * this case is reset(), which loads the sample data into the - * local storage. - * - * @return a list of Playable items loaded by reset(). - */ - Ptr::Ref - sampleData(void) throw () - { - return storage->getLocalSearchResults(); - } - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Open an audio clip. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - openAudioClipTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Acquire an audio clip. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - acquireAudioClipTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Open a playlist. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - openPlaylistTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Acquire a playlist. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - acquirePlaylistTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // GLiveSupportTest_h - diff --git a/src/products/gLiveSupport/src/GuiComponent.cxx b/src/products/gLiveSupport/src/GuiComponent.cxx deleted file mode 100644 index a1b7a02c8..000000000 --- a/src/products/gLiveSupport/src/GuiComponent.cxx +++ /dev/null @@ -1,71 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision: 3204 $ - Location : $URL: svn://code.campware.org/campcaster/trunk/campcaster/src/products/gLiveSupport/src/GuiComponent.cxx $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GLiveSupport.h" -#include "GuiComponent.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Protected constructor. - *----------------------------------------------------------------------------*/ -GuiComponent :: GuiComponent (GuiObject * parent, - const Glib::ustring & bundleName) - throw () - : GuiObject(), - parent(parent) -{ - if (bundleName == "") { - setBundle(parent->getBundle()); - } else { - setBundle(gLiveSupport->getBundle(bundleName)); - } - - glade = parent->getGlade(); -} - diff --git a/src/products/gLiveSupport/src/GuiComponent.h b/src/products/gLiveSupport/src/GuiComponent.h deleted file mode 100644 index 8a356101c..000000000 --- a/src/products/gLiveSupport/src/GuiComponent.h +++ /dev/null @@ -1,102 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GuiComponent_h -#define GuiComponent_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GuiObject.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The common ancestor of all window components in the GUI. - * These are non-standalone sub-windows, like the AdvancedSearchEntry, and - * sub-widgets of those, like the AdvancedSearchItem. - * - */ -class GuiComponent : public GuiObject -{ - protected: - - /** - * The parent object. - */ - GuiObject * parent; - - /** - * Protected constructor. - * - * @param parent the GuiObject which contains this one. - * @param bundleName the name of the localization resource bundle - * (optional); if missing, the parent's bundle - * is used. - */ - GuiComponent(GuiObject * parent, - const Glib::ustring & bundleName = "") - throw (); - - - public: - - /** - * Virtual destructor. - */ - virtual - ~GuiComponent(void) throw () - { - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // GuiComponent_h - diff --git a/src/products/gLiveSupport/src/GuiObject.cxx b/src/products/gLiveSupport/src/GuiObject.cxx deleted file mode 100644 index 0744b558b..000000000 --- a/src/products/gLiveSupport/src/GuiObject.cxx +++ /dev/null @@ -1,57 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GLiveSupport.h" -#include "GuiObject.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Protected constructor. - *----------------------------------------------------------------------------*/ -GuiObject :: GuiObject (void) - throw () - : LocalizedObject() -{ - gLiveSupport = GLiveSupport::getInstance(); -} - diff --git a/src/products/gLiveSupport/src/GuiObject.h b/src/products/gLiveSupport/src/GuiObject.h deleted file mode 100644 index dd633d5f4..000000000 --- a/src/products/gLiveSupport/src/GuiObject.h +++ /dev/null @@ -1,112 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GuiObject_h -#define GuiObject_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/LocalizedObject.h" - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -class GLiveSupport; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The common ancestor of all windows and sub-windows in the GUI. - * - */ -class GuiObject : public LocalizedObject -{ - protected: - - /** - * The GLiveSupport object, holding the state of the application. - */ - Ptr::Ref gLiveSupport; - - /** - * The Glade object, containing the visual design. - */ - Glib::RefPtr glade; - - /** - * Protected constructor. - */ - GuiObject(void) throw (); - - - public: - - /** - * Virtual destructor. - */ - virtual - ~GuiObject(void) throw () - { - } - - /** - * Get the Glade object. - */ - virtual Glib::RefPtr - getGlade(void) const throw () - { - return glade; - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // GuiObject_h - diff --git a/src/products/gLiveSupport/src/GuiWindow.cxx b/src/products/gLiveSupport/src/GuiWindow.cxx deleted file mode 100644 index 20008bc69..000000000 --- a/src/products/gLiveSupport/src/GuiWindow.cxx +++ /dev/null @@ -1,156 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GLiveSupport.h" -#include "GuiWindow.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/** - * The name of the application, shown on the task bar. - */ -const Glib::ustring applicationTitle = "Campcaster"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Protected constructor. - *----------------------------------------------------------------------------*/ -GuiWindow :: GuiWindow (const Glib::ustring & bundleName, - const Glib::ustring & gladeFileName, - Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiObject(), - windowOpenerButton(windowOpenerButton) -{ - setBundle(gLiveSupport->getBundle(bundleName)); - - glade = Gnome::Glade::Xml::create(gLiveSupport->getGladeDir() + - gladeFileName); - - glade->get_widget("mainWindow1", mainWindow); - setTitle(getResourceUstring("windowTitle")); - - mainWindow->signal_delete_event().connect(sigc::mem_fun(*this, - &GuiWindow::onDeleteEvent)); -} - - -/*------------------------------------------------------------------------------ - * Restore the window position and show the window. - *----------------------------------------------------------------------------*/ -void -GuiWindow :: show (void) throw () -{ - if (!mainWindow->is_visible()) { - preShow(); - mainWindow->show(); - } -} - - -/*------------------------------------------------------------------------------ - * Stuff to do before showing the window. - *----------------------------------------------------------------------------*/ -void -GuiWindow :: preShow (void) throw () -{ - gLiveSupport->getWindowPosition(this); - if (windowOpenerButton) { - windowOpenerButton->set_active(true); - } -} - - -/*------------------------------------------------------------------------------ - * Save the window position and hide the window. - *----------------------------------------------------------------------------*/ -void -GuiWindow :: hide (void) throw () -{ - if (mainWindow->is_visible()) { - preHide(); - mainWindow->hide(); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the close button getting clicked. - *----------------------------------------------------------------------------*/ -bool -GuiWindow :: onDeleteEvent (GdkEventAny * event) throw () -{ - preHide(); - return false; -} - - -/*------------------------------------------------------------------------------ - * Stuff to do before hiding the window. - *----------------------------------------------------------------------------*/ -void -GuiWindow :: preHide (void) throw () -{ - gLiveSupport->putWindowPosition(this); - if (windowOpenerButton) { - windowOpenerButton->set_active(false); - } -} - - -/*------------------------------------------------------------------------------ - * Set the title of the window. - *----------------------------------------------------------------------------*/ -void -GuiWindow :: setTitle (Ptr::Ref title) - throw () -{ - windowTitle = title; - - Glib::ustring fullTitle = applicationTitle; - fullTitle += " - "; - fullTitle += *title; - mainWindow->set_title(fullTitle); -} - diff --git a/src/products/gLiveSupport/src/GuiWindow.h b/src/products/gLiveSupport/src/GuiWindow.h deleted file mode 100644 index 607047816..000000000 --- a/src/products/gLiveSupport/src/GuiWindow.h +++ /dev/null @@ -1,184 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GuiWindow_h -#define GuiWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GuiObject.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The common ancestor of all standalone windows in the GUI. - * - */ -class GuiWindow : public GuiObject -{ - private: - - /** - * The title of the window. - */ - Ptr::Ref windowTitle; - - /** - * Stuff to do before showing the window. - */ - void - preShow(void) throw (); - - /** - * Stuff to do before hiding the window. - */ - void - preHide(void) throw (); - - - protected: - - /** - * The button which was used to open this window. - */ - Gtk::ToggleButton * windowOpenerButton; - - /** - * The window itself. - */ - Gtk::Window * mainWindow; - - /** - * Signal handler for the close button getting clicked. - */ - virtual bool - onDeleteEvent(GdkEventAny * event) throw (); - - /** - * Protected constructor. - * - * @param bundleName the name of the sub-bundle for this object. - * @param gladeFileName the name of the Glade file for this window. - * @param windowOpenerButton the button which was pressed to open - * this window (optional). - */ - GuiWindow(const Glib::ustring & bundleName, - const Glib::ustring & gladeFileName, - Gtk::ToggleButton * windowOpenerButton = 0) - throw (); - - - public: - - /** - * Virtual destructor. - */ - virtual - ~GuiWindow(void) throw () - { - } - - /** - * Restore the window position and show the window. - */ - virtual void - show(void) throw (); - - /** - * Save the window position and hide the window. - */ - virtual void - hide(void) throw (); - - /** - * Set the title of the window. - * - * Adds the application's title to the title of the window shown - * on the task bar. - * - * @param title the title of the window. - */ - virtual void - setTitle(Ptr::Ref title) throw (); - - /** - * A replacement for Gtk::Window::get_name(). - * - * @return the (localized) title of the window. - */ - virtual Ptr::Ref - getTitle(void) const throw () - { - return windowTitle; - } - - /** - * Get the underlying Gtk::Window. - */ - virtual Gtk::Window * - getWindow(void) throw () - { - return mainWindow; - } - - /** - * Get the underlying Gtk::Window. - */ - virtual const Gtk::Window * - getWindow(void) const throw () - { - return mainWindow; - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // GuiWindow_h - diff --git a/src/products/gLiveSupport/src/KeyboardShortcut.cxx b/src/products/gLiveSupport/src/KeyboardShortcut.cxx deleted file mode 100644 index ac2880390..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcut.cxx +++ /dev/null @@ -1,195 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "KeyboardShortcut.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string KeyboardShortcut::configElementName = "keyboardShortcut"; - -namespace { - -/** - * The name of the attribute of the action element. - */ -const std::string actionAttributeName = "action"; - -/** - * The name of the attribute of the key element. - */ -const std::string keyAttributeName = "key"; - -/* - * The modifier keys we check against. - * The following modifiers are omitted, hence ignored: - * Gdk::LOCK_MASK (caps lock), - * Gdk::MOD2_MASK (don't know what; always on on my computer), - * Gdk::MOD3_MASK (don't know what; always off on my computer), - * Gdk::BUTTONX_MASK (mouse buttons, X = 1..5). - */ -const Gdk::ModifierType modifiersChecked = Gdk::SHIFT_MASK - | Gdk::CONTROL_MASK - | Gdk::MOD1_MASK // Alt - | Gdk::MOD4_MASK // Windows key - | Gdk::MOD5_MASK; // AltGr - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Create a keyboard shortcut element object based on an XML element. - *----------------------------------------------------------------------------*/ -void -KeyboardShortcut :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementName) { - throw std::invalid_argument("bad coniguration element " - + element.get_name()); - } - - // set the action - xmlpp::Attribute * actionAttribute = element.get_attribute( - actionAttributeName); - if (actionAttribute) { - actionString.reset(new Glib::ustring(actionAttribute->get_value())); - try { - action = stringToAction(actionString); - } catch (std::invalid_argument &e) { - std::string eMsg = "Invalid action specification "; - eMsg += *actionString; - eMsg += "."; - throw std::invalid_argument(eMsg); - } - } else { - throw std::invalid_argument("missing " - + actionAttributeName + " attribute"); - } - - // set the key - xmlpp::Attribute * keyAttribute = element.get_attribute( - keyAttributeName); - if (keyAttribute) { - setKey(keyAttribute->get_value()); - } else { - throw std::invalid_argument("missing " - + keyAttributeName + " attribute"); - } -} - - -/*------------------------------------------------------------------------------ - * Set the shortcut key. - *----------------------------------------------------------------------------*/ -void -KeyboardShortcut :: setKey(const Glib::ustring & keyName) - throw (std::invalid_argument) -{ - shortcutKey = Gtk::AccelKey(keyName); - if (shortcutKey.get_key() == 0) { - throw std::invalid_argument("invalid shortcut key name"); - } -} - - -/*------------------------------------------------------------------------------ - * Tell whether the given modifier-key pair triggers this action. - *----------------------------------------------------------------------------*/ -bool -KeyboardShortcut :: isTriggeredBy(Gdk::ModifierType modifiers, - guint key) const - throw () -{ - Gdk::ModifierType myModifiers = modifiers & modifiersChecked; - - if (shortcutKey.get_mod() == myModifiers - && shortcutKey.get_key() == key) { - return true; - } else { - return false; - } -} - - -/*------------------------------------------------------------------------------ - * Convert an action name string to an enumeration value. - *----------------------------------------------------------------------------*/ -KeyboardShortcut::Action -KeyboardShortcut :: stringToAction(Ptr::Ref actionName) - throw (std::invalid_argument) -{ - if (*actionName == "playAudio") { - return playAudio; - } else if (*actionName == "pauseAudio") { - return pauseAudio; - } else if (*actionName == "stopAudio") { - return stopAudio; - } else if (*actionName == "nextTrack") { - return nextTrack; - } else if (*actionName == "fadeOut") { - return fadeOut; - } else if (*actionName == "moveItemUp") { - return moveItemUp; - } else if (*actionName == "moveItemDown") { - return moveItemDown; - } else if (*actionName == "removeItem") { - return removeItem; - } else { - throw std::invalid_argument(""); - } -} - - -/*------------------------------------------------------------------------------ - * Convert a modifiers-key code pair to a user-readable string. - *----------------------------------------------------------------------------*/ -Ptr::Ref -KeyboardShortcut :: modifiedKeyToString(Gdk::ModifierType modifiers, - guint key) - throw () -{ - Gtk::AccelKey accelKey(key, modifiers & modifiersChecked); - Ptr::Ref keyName(new Glib::ustring(accelKey.get_abbrev())); - return keyName; -} - diff --git a/src/products/gLiveSupport/src/KeyboardShortcut.h b/src/products/gLiveSupport/src/KeyboardShortcut.h deleted file mode 100644 index ace0693ae..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcut.h +++ /dev/null @@ -1,273 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef KeyboardShortcut_h -#define KeyboardShortcut_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A class for representing a keyboard shortcut. - * - * This object has to be configured with an XML configuration element - * called keyboardShortcut. This may look like the following: - * - *

- *  <keyboardShortcut    action  = "pauseAudio"
- *                          key     = "<Alt><Ctrl>P" />
- *  
- * - * The possible action values are the members of the Action enumeration. - * - * The possible key values are zero or more of the modifiers - * <Shift>, <Control> and <Alt>, followed by the - * name of the key, e.g., the letters A-Z (or a-z; they are not - * case-sensitive), the numbers 0-9, Space, Tab, etc. - * The key names are the ones defined in Gtk::AccelKey, used in the - * Gnome Keyboard Shortcuts applet, for example. - * (Note: Gtk::AccelKey is a wrapper for the gdk_keyval_name() and - * gdk_keyval_from_name() C functions in GDK.) - * - * There must be exactly one each of the action - * key attributes. - * - * The DTD for the expected XML element looks like the following: - * - *

- *  <!ELEMENT keyboardShortcut   EMPTY >
- *  <!ATTLIST keyboardShortcut   action  CDATA   #REQUIRED >
- *  <!ATTLIST keyboardShortcut   key     CDATA   #REQUIRED >
- *  
- * - * - * @see KeyboardShortcutContainer - */ -class KeyboardShortcut : public Configurable -{ - friend class KeyboardShortcutContainer; - - public: - /** - * An enumeration of all possible actions. - */ - typedef enum { noAction, - playAudio, - pauseAudio, - stopAudio, - nextTrack, - fadeOut, - moveItemUp, - moveItemDown, - removeItem } Action; - - - private: - /** - * The name of the configuration XML element used by KeyboardShortcut. - */ - static const std::string configElementName; - - /** - * The action associated with this keyboard shortcut. - */ - Action action; - - /** - * A string representation of the action. - */ - Ptr::Ref actionString; - - /** - * The key associated with this keyboard shortcut. - */ - Gtk::AccelKey shortcutKey; - - /** - * Convert an action name string to an enumeration value. - * If no matching enumeration value is found, noAction is returned. - * - * @param actionName a string containing the name of the action. - */ - Action - stringToAction(Ptr::Ref actionName) - throw(std::invalid_argument); - - - protected: - /** - * Default constructor. - */ - KeyboardShortcut() throw () - : action(noAction) - { - } - - /** - * Constructor. - * - * @param action the action associated with this object. - */ - KeyboardShortcut(Action action) throw () - : action(action) - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementName; - } - - /** - * Configure the metadata object based on an XML configuration element. - * - * @param elemen the XML configuration element. - * @exception std::invalid_argument of the supplied XML element - * contains bad configuration information - */ - virtual void - configure(const xmlpp::Element &element) - throw (std::invalid_argument); - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~KeyboardShortcut(void) throw () - { - } - - /** - * Return the action. - * - * @return the Action enumeration value associated with this object. - */ - Action - getAction(void) const throw () - { - return action; - } - - /** - * Set the shortcut key. - * - * @param keyName the string representation of the shortcut key. - */ - void - setKey(const Glib::ustring & keyName) - throw (std::invalid_argument); - - /** - * Tell whether the given modifier-key pair is one of those - * associated with this object. - * - * @return true if the modifier-key pair triggers this action, - * false if not. - */ - bool - isTriggeredBy(Gdk::ModifierType modifiers, - guint key) const throw (); - - /** - * Return a string corresponding to the action of this shortcut. - * - * @return a string representing the action of this shortcut. - */ - Ptr::Ref - getActionString(void) const throw () - { - return actionString; - } - - /** - * Return the first key associated with this shortcut. - * - * @return a string representing the first modifier-key pair of - * this shortcut. - */ - Ptr::Ref - getKeyString(void) const throw () - { - Ptr::Ref keyName(new Glib::ustring( - shortcutKey.get_abbrev() )); - return keyName; - } - - /** - * Convert a modifiers-key code pair to a user-readable string. - * - * @return a string representing the modifier-key pair. - */ - static Ptr::Ref - modifiedKeyToString(Gdk::ModifierType modifiers, - guint key) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // KeyboardShortcut_h - diff --git a/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx b/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx deleted file mode 100644 index efff3f818..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcutContainer.cxx +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "KeyboardShortcutContainer.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * The name of the config element for this class - */ -const std::string KeyboardShortcutContainer::configElementName - = "keyboardShortcutContainer"; -namespace { - -/** - * The name of the window name sub-element. - */ -const std::string windowNameAttributeName = "windowName"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Create a metadata type container element object based on an XML element. - *----------------------------------------------------------------------------*/ -void -KeyboardShortcutContainer :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementName) { - throw std::invalid_argument("bad coniguration element " - + element.get_name()); - } - - xmlpp::Node::NodeList childNodes = element.get_children( - KeyboardShortcut::getConfigElementName()); - xmlpp::Node::NodeList::const_iterator it = childNodes.begin(); - - while (it != childNodes.end()) { - const xmlpp::Element * keyboardShortcutElement - = dynamic_cast (*it); - - Ptr::Ref keyboardShortcut(new KeyboardShortcut); - keyboardShortcut->configure(*keyboardShortcutElement); - - shortcutList.push_back(keyboardShortcut); - ++it; - } - - xmlpp::Attribute * windowNameAttr = element.get_attribute( - windowNameAttributeName); - if (windowNameAttr) { - windowName.reset(new const Glib::ustring(windowNameAttr->get_value())); - } else { - throw std::invalid_argument("missing windowName attribute"); - } -} - -/*------------------------------------------------------------------------------ - * Return the action triggered by the given key. - *----------------------------------------------------------------------------*/ -KeyboardShortcut::Action -KeyboardShortcutContainer :: findAction(Gdk::ModifierType modifiers, - guint key) const - throw () -{ - ShortcutListType::const_iterator it = shortcutList.begin(); - - while (it != shortcutList.end()) { - Ptr::Ref shortcut = *it; - if (shortcut->isTriggeredBy(modifiers, key)) { - return shortcut->getAction(); - } - ++it; - } - - return KeyboardShortcut::noAction; -} - diff --git a/src/products/gLiveSupport/src/KeyboardShortcutContainer.h b/src/products/gLiveSupport/src/KeyboardShortcutContainer.h deleted file mode 100644 index cbbba7034..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcutContainer.h +++ /dev/null @@ -1,214 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef KeyboardShortcutContainer_h -#define KeyboardShortcutContainer_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" - -#include "KeyboardShortcut.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Container holding KeyboardShortcut objects. - * - * This object has to be configured with an XML configuration element - * called keyboardShortcutContainer. This may look like the following: - * - *

- *  <keyboardShortcutContainer
- *              windowName = "liveModeWindow">
- *      <keyboardShortcut> ... </keyboardShortcut>
- *      <keyboardShortcut> ... </keyboardShortcut>
- *      ...
- *      <keyboardShortcut> ... </keyboardShortcut>
- *  </keyboardShortcutContainer>
- *  
- * - * The DTD for the expected XML element is the following: - * - *

- *  
- *  
- *  
- * - * WindowName is an arbitrary utf-8 string which identifies the window the - * shortcuts are for. - * For a description of the keyboardShortcut XML element, see the documentation - * of the KeyboardShortcut class. - * - * @see KeyboardShortcut - */ -class KeyboardShortcutContainer : public Configurable -{ - private: - /** - * The name of the configuration XML element used by - * KeyboardShortcutContainer. - */ - static const std::string configElementName; - - /** - * A vector type holding contant KeyboardShortcut references. - */ - typedef std::vector::Ref> - ShortcutListType; - - /** - * The list of all KeyboardShortcut references. - */ - ShortcutListType shortcutList; - - /** - * The name of the window the shortcuts are for. - */ - Ptr::Ref windowName; - - - public: - /** - * Constructor. - */ - KeyboardShortcutContainer() throw () - { - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~KeyboardShortcutContainer(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementName; - } - - /** - * Configure the metadata object based on an XML configuration element. - * - * @param elemen the XML configuration element. - * @exception std::invalid_argument of the supplied XML element - * contains bad configuration information - */ - virtual void - configure(const xmlpp::Element &element) - throw (std::invalid_argument); - - /** - * Return the action triggered by the given key. - * Scans the keyboard shortcuts in order, and returns the first - * match. - * - * @param modifiers the gdktypes code of the modifiers flag. - * @param key the gdkkeysyms code of the key pressed. - * @return the action; or noAction if none is found. - */ - KeyboardShortcut::Action - findAction(Gdk::ModifierType modifiers, - guint key) const throw (); - - /** - * Return the name of the window the shortcuts are for. - * - * @return the name of the window; this may be 0 if (and only if) - * the object has not been configured yet. - */ - Ptr::Ref - getWindowName(void) const throw () - { - return windowName; - } - - /** - * The iterator for cycling through the keyboard shortcuts. - * Dereference an iterator to get a Ptr::Ref. - */ - typedef ShortcutListType::const_iterator iterator; - - /** - * The first item in the list. - */ - iterator - begin(void) const throw () - { - return shortcutList.begin(); - } - - /** - * One after the last item in the list. - */ - iterator - end(void) const throw () - { - return shortcutList.end(); - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // KeyboardShortcutContainer_h - diff --git a/src/products/gLiveSupport/src/KeyboardShortcutList.cxx b/src/products/gLiveSupport/src/KeyboardShortcutList.cxx deleted file mode 100644 index c2065beb5..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcutList.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "KeyboardShortcutList.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * The name of the config element for this class - */ -const std::string KeyboardShortcutList::configElementName - = "keyboardShortcutList"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Create a metadata type container element object based on an XML element. - *----------------------------------------------------------------------------*/ -void -KeyboardShortcutList :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementName) { - throw std::invalid_argument("bad coniguration element " - + element.get_name()); - } - - xmlpp::Node::NodeList nodes = element.get_children( - KeyboardShortcutContainer::getConfigElementName()); - xmlpp::Node::NodeList::const_iterator it = nodes.begin(); - while (it != nodes.end()) { - Ptr::Ref ksc(new KeyboardShortcutContainer); - ksc->configure(*((const xmlpp::Element*) *it)); - containerList.push_back(ksc); - ++it; - } -} - -/*------------------------------------------------------------------------------ - * Find the action triggered by the given key in the given window. - *----------------------------------------------------------------------------*/ -KeyboardShortcut::Action -KeyboardShortcutList :: findAction(const Glib::ustring & windowName, - Gdk::ModifierType modifiers, - guint key) const - throw () -{ - for (iterator it = begin(); it != end(); ++it) { - Ptr::Ref ksc = *it; - if (*ksc->getWindowName() == windowName) { - return ksc->findAction(modifiers, key); - } - } - - return KeyboardShortcut::noAction; -} - diff --git a/src/products/gLiveSupport/src/KeyboardShortcutList.h b/src/products/gLiveSupport/src/KeyboardShortcutList.h deleted file mode 100644 index 373e61507..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcutList.h +++ /dev/null @@ -1,186 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef KeyboardShortcutList_h -#define KeyboardShortcutList_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include // TODO: REMOVE ME - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" - -#include "KeyboardShortcutContainer.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A list of KeyboardShortcutContainer objects. - * - * This object has to be configured with an XML configuration element - * called keyboardShortcutList. - * - * The DTD for the expected XML element is the following: - *

- *  
- *  
- * - * For a description of the keyboardShortcutContainer XML element, - * see the documentation of the KeyboardShortcutContainer class. - * - * @see KeyboardShortcut - */ -class KeyboardShortcutList : public Configurable -{ - private: - /** - * The name of the configuration XML element used by - * KeyboardShortcutList. - */ - static const std::string configElementName; - - /** - * The type for storing the keyboard shortcut containers. - */ - typedef std::vector::Ref> - ContainerListType; - - /** - * The list of keyboard shortcut containers for the various windows. - */ - ContainerListType containerList; - - - public: - /** - * Constructor. - */ - KeyboardShortcutList() throw () - { - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~KeyboardShortcutList(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementName; - } - - /** - * Configure the metadata object based on an XML configuration element. - * - * @param elemen the XML configuration element. - * @exception std::invalid_argument of the supplied XML element - * contains bad configuration information - */ - virtual void - configure(const xmlpp::Element &element) - throw (std::invalid_argument); - - /** - * Find the action triggered by the given key in the given window. - * - * @param windowName a string identifying the window (not localized). - * @param modifiers the gdktypes code for the Shift, Ctrl etc. - * modifier keys which are pressed. - * @param key the gdkkeysyms code for the key pressed. - * @return the associated action; or noAction, if none is found. - */ - KeyboardShortcut::Action - findAction(const Glib::ustring & windowName, - Gdk::ModifierType modifiers, - guint key) const throw (); - - /** - * The iterator for cycling through the keyboard shortcut containers. - * Dereference an iterator to get a - * Ptr::Ref. - */ - typedef ContainerListType::const_iterator iterator; - - /** - * The first item in the list. - */ - iterator - begin(void) const throw () - { - return containerList.begin(); - } - - /** - * One after the last item in the list. - */ - iterator - end(void) const throw () - { - return containerList.end(); - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // KeyboardShortcutList_h - diff --git a/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx b/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx deleted file mode 100644 index a3fdb2398..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcutTest.cxx +++ /dev/null @@ -1,142 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#include - -#include "KeyboardShortcutContainer.h" -#include "KeyboardShortcutTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(KeyboardShortcutTest); - -namespace { - -/** - * The name of the test keyboard shortcut config file. - */ -const std::string configFileName = "etc/keyboardShortcut.xml"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -KeyboardShortcutTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - std::ifstream ifs; - ifs.open(configFileName.c_str()); - - if (!ifs.is_open() || ifs.bad()) { - ifs.close(); - CPPUNIT_FAIL("could not open keyboard shortcut config file " - + configFileName); - } - - ksc.reset(new KeyboardShortcutContainer); - - try { - Ptr::Ref parser(new xmlpp::DomParser()); - parser->parse_stream(ifs); - parser->set_validate(); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - - ksc->configure(*root); - - } catch (std::invalid_argument &e) { - ifs.close(); - CPPUNIT_FAIL("semantic error in keyboard shortcuts configuration file: " - + std::string(e.what())); - } catch (xmlpp::exception &e) { - ifs.close(); - CPPUNIT_FAIL("syntax error in keyboard shortcuts configuration file: " - + std::string(e.what())); - } - ifs.close(); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -KeyboardShortcutTest :: tearDown(void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * A simple test. - *----------------------------------------------------------------------------*/ -void -KeyboardShortcutTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0), GDK_p) - == KeyboardShortcut::playAudio); - - CPPUNIT_ASSERT(ksc->findAction(Gdk::MOD2_MASK | Gdk::LOCK_MASK, GDK_p) - == KeyboardShortcut::playAudio); - - CPPUNIT_ASSERT(ksc->findAction(Gdk::CONTROL_MASK, GDK_p) - == KeyboardShortcut::pauseAudio); - - CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0), GDK_space) - == KeyboardShortcut::stopAudio); - - CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0), GDK_q) - == KeyboardShortcut::noAction); - - CPPUNIT_ASSERT(ksc->findAction(Gdk::CONTROL_MASK, GDK_w) - == KeyboardShortcut::noAction); - - CPPUNIT_ASSERT(ksc->findAction(Gdk::ModifierType(0xffffff), 0xffffff) - == KeyboardShortcut::noAction); -} - diff --git a/src/products/gLiveSupport/src/KeyboardShortcutTest.h b/src/products/gLiveSupport/src/KeyboardShortcutTest.h deleted file mode 100644 index 6edd5333f..000000000 --- a/src/products/gLiveSupport/src/KeyboardShortcutTest.h +++ /dev/null @@ -1,111 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef KeyboardShortcutTest_h -#define KeyboardShortcutTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/BaseTestMethod.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Testing audio playback from the storage. - * - * @see KeyboardShortcutFactory - */ -class KeyboardShortcutTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(KeyboardShortcutTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The KeyboardShortcutContainer object we are testing. - */ - Ptr::Ref ksc; - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // KeyboardShortcutTest_h - diff --git a/src/products/gLiveSupport/src/LiveModeWindow.cxx b/src/products/gLiveSupport/src/LiveModeWindow.cxx deleted file mode 100644 index 13b864115..000000000 --- a/src/products/gLiveSupport/src/LiveModeWindow.cxx +++ /dev/null @@ -1,782 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" - -#include "LiveModeWindow.h" - - -using namespace Glib; - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "liveModeWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "LiveModeWindow.glade"; - -/*------------------------------------------------------------------------------ - * The name of the user preference for storing contents of the window. - *----------------------------------------------------------------------------*/ -const Glib::ustring userPreferencesKeyName = "liveModeContents"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -LiveModeWindow :: LiveModeWindow (Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton), - isDeleting(false) -{ - glade->get_widget_derived("treeView1", treeView); - treeView->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); - - treeView->appendLineNumberColumn("", 2 /* offset */, 50); - treeView->appendColumn("", modelColumns.infoColumn, 200); - - treeModel = Gtk::ListStore::create(modelColumns); - treeView->set_model(treeModel); - treeView->connectModelSignals(treeModel); - setupDndCallbacks(); - - treeView->signal_button_press_event().connect(sigc::mem_fun(*this, - &LiveModeWindow::onEntryClicked), - false /* call this first */); - treeView->signal_row_activated().connect(sigc::mem_fun(*this, - &LiveModeWindow::onDoubleClick)); - treeView->signalTreeModelChanged().connect(sigc::mem_fun(*this, - &LiveModeWindow::onTreeModelChanged)); - treeView->signal_key_press_event().connect(sigc::mem_fun(*this, - &LiveModeWindow::onKeyPressed)); - - glade->get_widget("cueLabel1", cueLabel); - cueLabel->set_label(*getResourceUstring("cuePlayerLabel")); - cuePlayer.reset(new CuePlayer(this, - treeView, - modelColumns)); - - glade->get_widget("autoPlayNext1", autoPlayNext); - autoPlayNext->set_label(*getResourceUstring("autoPlayNextLabel")); - - glade->connect_clicked("outputPlayButton1", sigc::mem_fun(*this, - &LiveModeWindow::onOutputPlay)); - - audioClipContextMenu = constructAudioClipContextMenu(); - playlistContextMenu = constructPlaylistContextMenu(); - - userPreferencesKey.reset(new const Glib::ustring(userPreferencesKeyName)); -} - - -/*------------------------------------------------------------------------------ - * Add a new item to the top of the Live Mode Window. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: addItem(Ptr::Ref playable) throw () -{ - addItem(treeModel->append(), playable); -} - - -/*------------------------------------------------------------------------------ - * Add a new item as the given row in the Live Mode Window. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: addItem(Gtk::TreeIter iter, - Ptr::Ref playable) throw () -{ - - Gtk::TreeModel::Row row = *iter; - row[modelColumns.playableColumn] = playable; - - Ptr::Ref infoString(new Glib::ustring); - - infoString->append(""); - infoString->append(Glib::Markup::escape_text(*playable->getTitle())); - infoString->append(""); - - // TODO: rewrite this using the Core::Metadata class - - Ptr::Ref - creator = playable->getMetadata("dc:creator"); - if (creator) { - infoString->append("\n"); - infoString->append(Glib::Markup::escape_text(*creator)); - infoString->append(""); - } - - Ptr::Ref - album = playable->getMetadata("dc:source"); - if (album) { - infoString->append("\n"); - infoString->append(Glib::Markup::escape_text(*album)); - infoString->append(""); - } - - infoString->append("\n" - "duration: "); - infoString->append(*TimeConversion::timeDurationToHhMmSsString( - playable->getPlaylength() )); - infoString->append(""); - - row[modelColumns.infoColumn] = *infoString; - - onTreeModelChanged(); -} - - -/*------------------------------------------------------------------------------ - * Add an item to the Live Mode window, by ID. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: addItem(Ptr::Ref id) - throw () -{ - Ptr::Ref playable; - try { - playable = gLiveSupport->acquirePlayable(id); - } catch (XmlRpcException &e) { - std::cerr << "could not acquire playable in LiveModeWindow: " - << e.what() << std::endl; - return; - } - - addItem(playable); -} - - -/*------------------------------------------------------------------------------ - * Add an item to the Live Mode window at the given position, by ID. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: addItem(Gtk::TreeIter iter, - Ptr::Ref id) - throw () -{ - Ptr::Ref playable; - try { - playable = gLiveSupport->acquirePlayable(id); - } catch (XmlRpcException &e) { - std::cerr << "could not acquire playable in LiveModeWindow: " - << e.what() << std::endl; - return; - } - - addItem(iter, playable); -} - - -/*------------------------------------------------------------------------------ - * "Pop" the first item from the top of the Live Mode Window. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveModeWindow :: popTop(void) throw () -{ - Ptr::Ref playable; - if (!autoPlayNext->get_active()) { - return playable; // return a 0 pointer if auto is set to off - } - - Gtk::TreeIter iter = treeModel->children().begin(); - if (iter) { - playable = (*iter)[modelColumns.playableColumn]; - treeModel->erase(iter); - } - gLiveSupport->runMainLoop(); - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Event handler for an entry being clicked in the list. - *----------------------------------------------------------------------------*/ -bool -LiveModeWindow :: onEntryClicked(GdkEventButton * event) throw () -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - Ptr::Ref playable = getFirstSelectedPlayable(); - - if (selectedPaths->size() == 1) { - if (playable->getType() == Playable::AudioClipType) { - audioClipContextMenu->popup(event->button, event->time); - return true; - - } else if (playable->getType() == Playable::PlaylistType) { - playlistContextMenu->popup(event->button, event->time); - return true; - } - - } else if (selectedPaths->size() > 1) { - audioClipContextMenu->popup(event->button, event->time); - return true; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Return the first selected playable item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveModeWindow :: getFirstSelectedPlayable(void) throw () -{ - Ptr::Ref playable; - - Glib::RefPtr - selection = treeView->get_selection(); - selectedPaths.reset(new std::vector( - selection->get_selected_rows())); - - if (selectedPaths->size() > 0) { - selectedIter = selectedPaths->begin(); - Gtk::TreeRow row = *(treeModel->get_iter(*selectedIter)); - playable = row[modelColumns.playableColumn]; - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Return the next selected playable item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveModeWindow :: getNextSelectedPlayable(void) throw () -{ - Ptr::Ref playable; - - if (selectedPaths) { - if (selectedIter != selectedPaths->end()) { - Gtk::TreeRow row = *(treeModel->get_iter(*selectedIter)); - playable = row[modelColumns.playableColumn]; - ++selectedIter; - } else { - selectedPaths.reset(); - } - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the user double-clicking or pressing Enter. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onDoubleClick(const Gtk::TreeModel::Path & path, - const Gtk::TreeViewColumn * column) - throw () -{ - onOutputPlay(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for a key pressed. - *----------------------------------------------------------------------------*/ -bool -LiveModeWindow :: onKeyPressed(GdkEventKey * event) throw () -{ - if (event->type == GDK_KEY_PRESS) { - KeyboardShortcut::Action action = gLiveSupport->findAction( - "liveModeWindow", - Gdk::ModifierType(event->state), - event->keyval); - switch (action) { - case KeyboardShortcut::moveItemUp : - if (selectionIsSingle()) { - treeView->onUpMenuOption(); - return true; - } - break; - - case KeyboardShortcut::moveItemDown : - if (selectionIsSingle()) { - treeView->onDownMenuOption(); - return true; - } - break; - - case KeyboardShortcut::removeItem : - onRemoveMenuOption(); - return true; - break; - - case KeyboardShortcut::playAudio : - onOutputPlay(); - return true; - break; - - default : break; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Check whether exactly one row is selected. - *----------------------------------------------------------------------------*/ -bool -LiveModeWindow :: selectionIsSingle(void) throw () -{ - getFirstSelectedPlayable(); - - return (selectedPaths->size() == 1); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the output play button clicked. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onOutputPlay(void) throw () -{ - Gtk::TreeIter itemPlayed; - Ptr::Ref playable = getFirstSelectedPlayable(); - - if (playable) { - itemPlayed = treeModel->get_iter(*selectedIter); - } else { - itemPlayed = treeModel->children().begin(); - if (itemPlayed) { - playable = (*itemPlayed)[modelColumns.playableColumn]; - } - } - - if (playable) { - try { - gLiveSupport->setNowPlaying(playable); - if(false == gLiveSupport->playOutputAudio(playable)) - { - treeView->removeItem(itemPlayed); - return; - } - - treeView->removeItem(itemPlayed); - - gLiveSupport->runMainLoop(); - - } catch (std::runtime_error &e) { - std::cerr << "cannot play on live mode output device: " - << e.what() << std::endl; - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Edit Playlist menu item selected from the - * entry context menu. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onEditPlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - try { - gLiveSupport->openPlaylistForEditing(playlist->getId()); - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(*getResourceUstring( - "cannotEditPlaylistMsg" )); - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Schedule Playlist menu item selected from the - * entry context menu. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onSchedulePlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - schedulePlaylistWindow.reset(new SchedulePlaylistWindow(playlist)); - schedulePlaylistWindow->getWindow()->set_transient_for(*mainWindow); - Gtk::Main::run(*schedulePlaylistWindow->getWindow()); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "export playlist" in the context menu. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onExportPlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - exportPlaylistWindow.reset(new ExportPlaylistWindow(playlist)); - exportPlaylistWindow->getWindow()->set_transient_for(*mainWindow); - Gtk::Main::run(*exportPlaylistWindow->getWindow()); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Add To Playlist menu item selected from the - * entry context menu - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onAddToPlaylist(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - try { - gLiveSupport->addToPlaylist(playable->getId()); - } catch (XmlRpcException &e) { - std::cerr << "error in LiveModeWindow::onAddToPlaylist(): " - << e.what() << std::endl; - return; - } - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "upload to hub" in the context menu. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onUploadToHub(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - gLiveSupport->uploadToHub(playable); - } -} - - -/*------------------------------------------------------------------------------ - * Refresh the playlist in the window. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: refreshPlaylist(Ptr::Ref playlist) throw () -{ - for (Gtk::TreeIter iter = treeModel->children().begin(); - iter != treeModel->children().end(); ++iter) { - Ptr::Ref currentItem = (*iter)[modelColumns.playableColumn]; - if (*currentItem->getId() == *playlist->getId()) { - addItem(iter, currentItem); - } - } -} - - -/*------------------------------------------------------------------------------ - * Construct the right-click context menu for local audio clips. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveModeWindow :: constructAudioClipContextMenu(void) throw () -{ - Ptr::Ref contextMenu(new Gtk::Menu()); - Gtk::Menu::MenuList & contextMenuList = contextMenu->items(); - - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("playMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onOutputPlay))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("cueMenuItem"), - sigc::mem_fun(*cuePlayer, - &CuePlayer::onPlayItem))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToPlaylistMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onAddToPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("removeMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onRemoveMenuOption))); - contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem()); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("uploadToHubMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onUploadToHub))); - - contextMenu->accelerate(*mainWindow); - return contextMenu; -} - - -/*------------------------------------------------------------------------------ - * Construct the right-click context menu for local playlists. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveModeWindow :: constructPlaylistContextMenu(void) throw () -{ - Ptr::Ref contextMenu(new Gtk::Menu()); - Gtk::Menu::MenuList & contextMenuList = contextMenu->items(); - - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("playMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onOutputPlay))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("cueMenuItem"), - sigc::mem_fun(*cuePlayer, - &CuePlayer::onPlayItem))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToPlaylistMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onAddToPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("removeMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onRemoveMenuOption))); - contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem()); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("editPlaylistMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onEditPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("schedulePlaylistMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onSchedulePlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("exportPlaylistMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onExportPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem()); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("uploadToHubMenuItem"), - sigc::mem_fun(*this, - &LiveModeWindow::onUploadToHub))); - - contextMenu->accelerate(*mainWindow); - return contextMenu; -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Remove menu item selected from the context menu. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onRemoveMenuOption(void) throw () -{ - isDeleting = true; - - Glib::RefPtr selection - = treeView->get_selection(); - std::vector selectedPaths - = selection->get_selected_rows(); - - std::vector selectedIters; - for (std::vector::iterator pathIt = selectedPaths.begin(); - pathIt != selectedPaths.end(); - ++pathIt) { - selectedIters.push_back(treeModel->get_iter(*pathIt)); - } - - Gtk::TreeIter newSelection; - for (std::vector::iterator iterIt = selectedIters.begin(); - iterIt != selectedIters.end(); - ++iterIt) { - newSelection = *iterIt; - ++newSelection; - treeModel->erase(*iterIt); - } - - if (newSelection) { - selection->select(newSelection); - } - - isDeleting = false; - onTreeModelChanged(); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for a change in the tree model. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: onTreeModelChanged(void) throw () -{ - if (isDeleting) { - return; - } - - Gtk::TreeIter iter = treeModel->children().begin(); - - if (iter) { - Ptr::Ref playable = (*iter)[modelColumns.playableColumn]; - if (playable) { - if (!savedTopPlayable || - *savedTopPlayable->getId() != *playable->getId()) { - gLiveSupport->preload(playable); - } - savedTopPlayable = playable; - } - } -} - - -/*------------------------------------------------------------------------------ - * Update the strings in the widget. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: updateStrings(void) throw () -{ - setBundle(gLiveSupport->getBundle("liveModeWindow")); - - setTitle(getResourceUstring("windowTitle")); - cueLabel->set_label(*getResourceUstring("cuePlayerLabel")); -} - - -/*------------------------------------------------------------------------------ - * Return the contents of the Scratchpad. - *----------------------------------------------------------------------------*/ -Ptr::Ref -LiveModeWindow :: getContents(void) throw () -{ - std::ostringstream contentsStream; - - contentsStream << int(autoPlayNext->get_active()) << " "; - - Gtk::TreeModel::const_iterator it; - for (it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - Gtk::TreeRow row = *it; - Ptr::Ref playable = row[modelColumns.playableColumn]; - contentsStream << playable->getId()->getId() << " "; - } - - Ptr::Ref contents(new Glib::ustring( - contentsStream.str() )); - return contents; -} - - -/*------------------------------------------------------------------------------ - * Restore the contents of the Scratchpad. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: setContents(Ptr::Ref contents) - throw () -{ - std::istringstream contentsStream(*contents); - if (contentsStream.eof()) { - return; - } - - int autoPlayNextValue; - contentsStream >> autoPlayNextValue; - autoPlayNext->set_active(autoPlayNextValue); - - std::vector contentsVector; - while (!contentsStream.eof()) { - UniqueId::IdType nextItem; - contentsStream >> nextItem; - if (contentsStream.fail()) { - contentsStream.clear(); - contentsStream.ignore(); - } else { - contentsVector.push_back(nextItem); - } - } - - treeModel->clear(); - std::vector::reverse_iterator it; - - for (it = contentsVector.rbegin(); it != contentsVector.rend(); ++it) { - Ptr::Ref id(new const UniqueId(*it)); - addItem(id); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler called when the the window gets hidden. - *----------------------------------------------------------------------------*/ -void -LiveModeWindow :: hide(void) throw () -{ - if (exportPlaylistWindow) { - exportPlaylistWindow->getWindow()->hide(); - } - if (schedulePlaylistWindow) { - schedulePlaylistWindow->getWindow()->hide(); - } - - GuiWindow::hide(); -} - - -/*------------------------------------------------------------------------------ - * The name of the window for the d'n'd methods. - *----------------------------------------------------------------------------*/ -Glib::ustring -LiveModeWindow :: getWindowNameForDnd (void) throw () -{ - return bundleName; -} - diff --git a/src/products/gLiveSupport/src/LiveModeWindow.h b/src/products/gLiveSupport/src/LiveModeWindow.h deleted file mode 100644 index 85391d00f..000000000 --- a/src/products/gLiveSupport/src/LiveModeWindow.h +++ /dev/null @@ -1,492 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LiveModeWindow_h -#define LiveModeWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "GuiWindow.h" -#include "ContentsStorable.h" -#include "DndMethods.h" - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "CuePlayer.h" -#include "GLiveSupport.h" -#include "ExportPlaylistWindow.h" -#include "SchedulePlaylistWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The LiveMode window, showing recent and relevant audio clips and - * playlists. - * - */ -class LiveModeWindow : public GuiWindow, - public ContentsStorable, - public DndMethods -{ - private: - - /** - * The Playable item at the top of the window. - */ - Ptr::Ref savedTopPlayable; - - /** - * A flag used to disable preload() while deleting items. - */ - bool isDeleting; - - /** - * The user preferences key. - */ - Ptr::Ref userPreferencesKey; - - /** - * The Export Playlist pop-up window. - */ - Ptr::Ref exportPlaylistWindow; - - /** - * The Schedule Playlist pop-up window. - */ - Ptr::Ref schedulePlaylistWindow; - - /** - * The cue player widget with play/pause and stop buttons. - */ - Ptr::Ref cuePlayer; - - /** - * The label for the cue player. - */ - Gtk::Label * cueLabel; - - /** - * If checked, the top item in the window will start playing - * automatically after the current one finishes. - */ - Gtk::CheckButton * autoPlayNext; - - /** - * The list of selected rows, as path references (row numbers). - * Reset by onEntryClicked(). - */ - Ptr >::Ref selectedPaths; - /** - * One of the selected rows, set to the first one by onEntryClicked(). - * Incremented by getNextSelectedPlayable(). - */ - std::vector::const_iterator selectedIter; - - /** - * Construct the right-click context menu for local audio clips. - * - * @return the context menu created. - */ - Ptr::Ref - constructAudioClipContextMenu(void) throw (); - - /** - * Construct the right-click context menu for local playlists. - * - * @return the context menu created. - */ - Ptr::Ref - constructPlaylistContextMenu(void) throw (); - - /** - * Check whether exactly one row is selected. - * - * This is an auxilliary function used by onKeyPressed(). - * - * @return true if a single row is selected, false if not. - */ - bool - selectionIsSingle(void) throw (); - - - protected: - - /** - * The columns model needed by Gtk::TreeView. - * Lists one clip per row. - * - */ - class ModelColumns : public PlayableTreeModelColumnRecord - { - public: - /** - * The column for the title, creator, etc. - */ - Gtk::TreeModelColumn infoColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(infoColumn); - } - }; - - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * The tree view, now only showing rows. - */ - ZebraTreeView * treeView; - - /** - * The tree model, as a GTK reference. - */ - Glib::RefPtr treeModel; - - /** - * The right-click context menu for audio clips. - */ - Ptr::Ref audioClipContextMenu; - - /** - * The right-click context menu for playlists. - */ - Ptr::Ref playlistContextMenu; - - /** - * Signal handler for the output play button clicked - * or the output play menu option selected. - */ - void - onOutputPlay(void) throw (); - - /** - * Signal handler for the mouse clicked on one of the entries. - * This brings up the right-click context menu. - * - * @param event the button event recieved - * @return true if the event has been handled (a popup displayed), - * false otherwise - */ - bool - onEntryClicked(GdkEventButton * event) throw (); - - /** - * Signal handler for the user double-clicking, or pressing Enter - * on one of the entries. - * - * @param path the TreePath of the row clicked on (ignored). - * @param column the TreeViewColumn clicked on (ignored). - */ - void - onDoubleClick(const Gtk::TreeModel::Path & path, - const Gtk::TreeViewColumn * column) - throw (); - - /** - * Signal handler for a key pressed at one of the entries. - * The keys can be customized by the keyboardShortcutContainer - * element in the gLiveSupport configuration file. - * - * The actions handled are: moveItemUp, moveItemDown, removeItem, - * and playAudio (which plays the item in the output player). - * - * @param event the button event received - * @return true if the key press was fully handled, false if not - */ - bool - onKeyPressed(GdkEventKey * event) throw (); - - /** - * Signal handler for the "edit playlist" menu item selected from - * the entry context menu. - */ - virtual void - onEditPlaylist(void) throw (); - - /** - * Signal handler for the "schedule playlist" menu item selected - * from the entry context menu. - */ - virtual void - onSchedulePlaylist(void) throw (); - - /** - * Signal handler for the "export playlist" menu item selected from - * the entry context menu. - */ - virtual void - onExportPlaylist(void) throw (); - - /** - * Signal handler for the "add to playlist" menu item selected from - * the entry context menu. - */ - virtual void - onAddToPlaylist(void) throw (); - - /** - * Signal handler for the "upload to hub" menu item selected from - * the entry context menu. - */ - virtual void - onUploadToHub(void) throw (); - - /** - * Signal handler for the "remove" menu item selected from - * the entry context menu. - */ - virtual void - onRemoveMenuOption(void) throw (); - - /** - * Signal handler for a change in the tree model. - */ - virtual void - onTreeModelChanged(void) throw (); - - /** - * The tree view we want to implement d'n'd on. - */ - virtual Gtk::TreeView * - getTreeViewForDnd (void) throw () - { - return treeView; - } - - /** - * The name of the window for the d'n'd methods. - */ - virtual Glib::ustring - getWindowNameForDnd (void) throw (); - - /** - * Return the topmost selected row. - * Sets selectedPaths and selectedIter; does not increment it. - * - * @return the first selected playable item. - */ - virtual Ptr::Ref - getFirstSelectedPlayable (void) throw (); - - /** - * Used to iterate over the selected rows. - * Reset to the first row by onEntryClicked(). - * Returns a 0 pointer if nothing is selected or we have reached - * the end of the list of selected rows. - * - * @return the next selected playable item. - */ - virtual Ptr::Ref - getNextSelectedPlayable (void) throw (); - - /** - * Add an item to the d'n'd tree view at the given position. - * - * @param iter the iterator pointing to the row to be filled in. - * @param id the ID of the item to add. - */ - virtual void - addItem (Gtk::TreeIter iter, - Ptr::Ref id) throw (); - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - LiveModeWindow(Gtk::ToggleButton * windowOpenerButton) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~LiveModeWindow(void) throw () - { - } - - /** - * Add a new item to the top of the Live Mode Window. - * - * @param playable the playable object to be added. - */ - void - addItem(Ptr::Ref playable) throw (); - - /** - * Add a new item as the given row in the Live Mode Window. - * - * @param iter an iterator pointing to the row to be updated. - * @param playable the playable object to be added. - */ - void - addItem(Gtk::TreeIter iter, - Ptr::Ref playable) throw (); - - /** - * Add an item to the top of the Live Mode Window, by ID. - * - * @param id the id of the item to add. - * @see setContents(). - */ - void - addItem(Ptr::Ref id) throw (); - - /** - * "Pop" the first item from the top of the Live Mode Window. - * - * @return the playable object at the top of the window, - * or 0 if the window is empty. - */ - Ptr::Ref - popTop(void) throw (); - - /** - * Update the cue player display to show a stopped state. - */ - void - showCuePlayerStopped(void) throw () - { - cuePlayer->onStop(); - } - - /** - * Refresh the playlist in the window. - * Updates the playlist to the new copy supplied in the argument, - * if it is present in the window. - * This is called by GLiveSupport::savePlaylist() after the playlist - * has been edited. - * - * @param playlist the new version of the playlist. - */ - void - refreshPlaylist(Ptr::Ref playlist) throw (); - - /** - * Report whether the window is non-empty. - * - * @return true if there is at least one Playable item in the window. - */ - bool - isNotEmpty(void) throw () - { - return (treeModel->children().size() != 0); - } - - /** - * Update the localized strings in the widget. - */ - void - updateStrings(void) throw (); - - /** - * Return the contents of the Live Mode window. - * This means the list of audio files, plus the state of the - * autoPlayNext checkbox. - * - * @return 0 or 1, followed by a space-separated list of the - * unique IDs, in base 10. - */ - Ptr::Ref - getContents(void) throw (); - - /** - * Restore the contents of the Scratchpad. - * The current contents are discarded, and replaced with the items - * listed in the 'contents' parameter. - * - * @param contents 0 or 1, followed by a space-separated list of the - * unique IDs, in base 10. - */ - void - setContents(Ptr::Ref contents) throw (); - - /** - * Return the user preferences key. - * The contents of the window will be stored in the user preferences - * under this key. - * - * @return the user preference key. - */ - Ptr::Ref - getUserPreferencesKey(void) throw () - { - return userPreferencesKey; - } - - /** - * Hide the window. - * - * This overrides GuiWindow::hide(), and closes the Export Playlist - * and Schedule Playlist pop-up windows, if they are still open. - */ - virtual void - hide(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // LiveModeWindow_h - diff --git a/src/products/gLiveSupport/src/LoginWindow.cxx b/src/products/gLiveSupport/src/LoginWindow.cxx deleted file mode 100644 index 1e71799f5..000000000 --- a/src/products/gLiveSupport/src/LoginWindow.cxx +++ /dev/null @@ -1,198 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GLiveSupport.h" -#include "LoginWindow.h" - - -using namespace Glib; - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "loginWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "LoginWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -LoginWindow :: LoginWindow (void) - throw () - : GuiWindow(bundleName, - gladeFileName), - loggedIn(false) -{ - // localize everything - Gtk::Label * userNameLabel; - Gtk::Label * passwordLabel; - Gtk::Label * languageLabel; - glade->get_widget("userNameLabel1", userNameLabel); - glade->get_widget("passwordLabel1", passwordLabel); - glade->get_widget("languageLabel1", languageLabel); - userNameLabel->set_text(*getResourceUstring("userNameLabel")); - passwordLabel->set_text(*getResourceUstring("passwordLabel")); - languageLabel->set_text(*getResourceUstring("languageLabel")); - - // fill up the language list with the list of available languages - glade->get_widget_derived("languageEntry1", languageEntry); - - Ptr::Ref - languages = gLiveSupport->getSupportedLanguages(); - for (GLiveSupport::LanguageMap::const_iterator - it = languages->begin(); it != languages->end(); ++it) { - Glib::ustring language = it->first; - languageEntry->append_text(language); - } - languageEntry->set_active(0); - - // connect signal handlers - glade->connect_clicked("okButton1", sigc::mem_fun(*this, - &LoginWindow::onOkButtonClicked)); - glade->connect_clicked("cancelButton1", sigc::mem_fun(*this, - &LoginWindow::onCancelButtonClicked)); - - glade->get_widget("userNameEntry1", userNameEntry); - userNameEntry->signal_activate().connect(sigc::mem_fun(*this, - &LoginWindow::onUserNameEntryActivated)); - glade->get_widget("passwordEntry1", passwordEntry); - passwordEntry->signal_activate().connect(sigc::mem_fun(*this, - &LoginWindow::onPasswordEntryActivated)); - - // clear the status bar - glade->get_widget("statusBar1", statusBar); - statusBar->set_text(""); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -LoginWindow :: ~LoginWindow (void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the Enter key pressed in the user name entry. - *----------------------------------------------------------------------------*/ -void -LoginWindow :: onUserNameEntryActivated (void) throw () -{ - passwordEntry->grab_focus(); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the Enter key pressed in the password entry. - *----------------------------------------------------------------------------*/ -void -LoginWindow :: onPasswordEntryActivated (void) throw () -{ - onOkButtonClicked(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the OK button getting clicked. - *----------------------------------------------------------------------------*/ -void -LoginWindow :: onOkButtonClicked (void) throw () -{ - statusBar->set_text(*getResourceUstring("pleaseWaitMsg")); - mainWindow->set_sensitive(false); - gLiveSupport->runMainLoop(); // redraw the window - - userNameText.reset(new Glib::ustring(userNameEntry->get_text())); - passwordText.reset(new Glib::ustring(passwordEntry->get_text())); - - Ptr::Ref languages; - languages = gLiveSupport->getSupportedLanguages(); - - GLiveSupport::LanguageMap::const_iterator - langSel = languages->find(languageEntry->get_active_text()); - selectedLocale.reset(new std::string(langSel->second)); - - loggedIn = gLiveSupport->login(*getLogin(), *getPassword()); - - if (loggedIn) { - if (selectedLocale->size() > 0) { - gLiveSupport->changeLanguage(selectedLocale); - } else { - // TODO: get and set default locale for user - } - - gLiveSupport->createScratchpadWindow(); - } - - mainWindow->hide(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the cancel button getting clicked. - *----------------------------------------------------------------------------*/ -void -LoginWindow :: onCancelButtonClicked (void) throw () -{ - mainWindow->hide(); -} - - -/*------------------------------------------------------------------------------ - * Show the window, and return whether the login was successful. - *----------------------------------------------------------------------------*/ -bool -LoginWindow :: run(void) throw () -{ - Gtk::Main::run(*mainWindow); - return loggedIn; -} - - diff --git a/src/products/gLiveSupport/src/LoginWindow.h b/src/products/gLiveSupport/src/LoginWindow.h deleted file mode 100644 index 7f93fcfdf..000000000 --- a/src/products/gLiveSupport/src/LoginWindow.h +++ /dev/null @@ -1,182 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LoginWindow_h -#define LoginWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/ComboBoxText.h" -#include "GuiWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A window, handling user login. - * - */ -class LoginWindow : public GuiWindow -{ - private: - - /** - * The user name text entry area. - */ - Gtk::Entry * userNameEntry; - - /** - * The password text entry area. - */ - Gtk::Entry * passwordEntry; - - /** - * The drop-down list to select the desired language. - */ - ComboBoxText * languageEntry; - - /** - * The status bar. - */ - Gtk::Label * statusBar; - - /** - * The user name text entered by the user. - */ - Ptr::Ref userNameText; - - /** - * The password text entered by the user. - */ - Ptr::Ref passwordText; - - /** - * The locale / language selected by the user. - */ - Ptr::Ref selectedLocale; - - /** - * Flag to show that the user has successfully logged in. - */ - bool loggedIn; - - /** - * Signal handler for the Enter key pressed in the user name entry. - */ - virtual void - onUserNameEntryActivated(void) throw (); - - /** - * Signal handler for the Enter key pressed in the password entry. - */ - virtual void - onPasswordEntryActivated(void) throw (); - - /** - * Signal handler for the ok button clicked. - */ - virtual void - onOkButtonClicked(void) throw (); - - /** - * Signal handler for the cancel button clicked. - */ - virtual void - onCancelButtonClicked(void) throw (); - - /** - * Get the password entered by the user. - * - * @return the password entered by the user. - */ - Ptr::Ref - getPassword(void) const throw () - { - return passwordText; - } - - public: - - /** - * Constructor. - */ - LoginWindow(void) throw (); - - /** - * Virtual destructor. - */ - virtual - ~LoginWindow(void) throw (); - - /** - * Get the login entered by the user. - * - * @return the login entered by the user. - */ - Ptr::Ref - getLogin(void) const throw () - { - return userNameText; - } - - /** - * Show the window, and return whether the login was successful. - * - * @return true if the login was successful. - */ - bool - run(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // LoginWindow_h - diff --git a/src/products/gLiveSupport/src/MasterPanelWindow.cxx b/src/products/gLiveSupport/src/MasterPanelWindow.cxx deleted file mode 100644 index ddc0c85d7..000000000 --- a/src/products/gLiveSupport/src/MasterPanelWindow.cxx +++ /dev/null @@ -1,814 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LoginWindow.h" - -#include "MasterPanelWindow.h" - - -using namespace LiveSupport; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "masterPanelWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "MasterPanelWindow.glade"; - -/*------------------------------------------------------------------------------ - * The name of the application, shown on the task bar. - *----------------------------------------------------------------------------*/ -const Glib::ustring applicationTitleSuffix = " - Campcaster"; - -/*------------------------------------------------------------------------------ - * Number of times per second that onUpdateTime() is called. - * It's a good idea to make this a divisor of 1000. - *----------------------------------------------------------------------------*/ -const int updateTimeConstant = 20; - -/*------------------------------------------------------------------------------ - * The delay between two checks on the progress of an asynchronous method - * (in seconds). - *----------------------------------------------------------------------------*/ -const int asyncUpdateFrequency = 10; - -/** - * The delay between two RDS updates (in seconds). - */ -const int rdsUpdateFrequency = 10; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -MasterPanelWindow :: MasterPanelWindow (void) - throw () - : GuiWindow(bundleName, - gladeFileName), - userIsLoggedIn(false) -{ - // load the station logo image - Gtk::Image * stationLogoImage; - glade->get_widget("stationLogoImage1", stationLogoImage); - stationLogoImage->set(gLiveSupport->getStationLogoPixbuf()); - - // set up the time label - glade->get_widget("timeLabel1", timeLabel); - Pango::Attribute fontDescriptionAttribute = - Pango::Attribute::create_attr_font_desc( - Pango::FontDescription( - "Bitstream Vera Sans Bold 20")); - fontDescriptionAttribute.set_start_index(0); - fontDescriptionAttribute.set_end_index(10); - Pango::AttrList timeLabelAttributes; - timeLabelAttributes.insert(fontDescriptionAttribute); - timeLabel->set_attributes(timeLabelAttributes); - - // register the signal handlers for the main window - glade->get_widget("mainWindow1", mainWindow); - mainWindow->signal_key_press_event().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onKeyPressed)); - - // create the Now Playing widget - Gtk::Box * nowPlayingBox; - glade->get_widget("nowPlayingWidget1", nowPlayingBox); - nowPlayingWidget.reset(new NowPlaying(this)); - - // get a reference for the window-opener buttons - glade->get_widget("liveModeButton1", liveModeButton); - glade->get_widget("uploadFileButton1", uploadFileButton); - glade->get_widget("scratchpadButton1", scratchpadButton); - glade->get_widget("playlistButton1", playlistButton); - glade->get_widget("schedulerButton1", schedulerButton); - glade->get_widget("searchButton1", searchButton); - glade->get_widget("optionsButton1", optionsButton); - - // get a reference for some other widgets - glade->get_widget("mainButtonBox1", mainButtonBox); - glade->get_widget("userInfoLabel1", userInfoLabel); - glade->get_widget("loginButton1", loginButton); - - // bind events to the buttons - liveModeButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onLiveModeButtonClicked)); - uploadFileButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onUploadFileButtonClicked)); - scratchpadButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onScratchpadButtonClicked)); - playlistButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onPlaylistButtonClicked)); - schedulerButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onSchedulerButtonClicked)); - searchButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onSearchButtonClicked)); - optionsButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onOptionsButtonClicked)); - - loginButton->signal_clicked().connect(sigc::mem_fun( - *this, - &MasterPanelWindow::onLoginButtonClicked)); - - // set the size and location of the window, according to the screen size - Glib::RefPtr screen = mainWindow->get_screen(); - mainWindow->set_default_size(screen->get_width(), -1); - mainWindow->move(0, 0); - - // show what's there to see - showAnonymousUI(); - updateUserInfo(); - - // set the timer, that will update timeLabel - setTimer(); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -MasterPanelWindow :: ~MasterPanelWindow (void) throw () -{ - resetTimer(); - gLiveSupport->stopOutputAudio(); - gLiveSupport->stopCueAudio(); -} - - -/*------------------------------------------------------------------------------ - * Change the language of the panel - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: changeLanguage (void) - throw () -{ - Ptr::Ref newBundle = gLiveSupport->getBundle( - bundleName); - setBundle(newBundle); - nowPlayingWidget->changeLanguage(); - - setTitle(getResourceUstring("windowTitle")); - - liveModeButton->set_label(*getResourceUstring( - "liveModeButtonLabel")); - uploadFileButton->set_label(*getResourceUstring( - "uploadFileButtonLabel")); - scratchpadButton->set_label(*getResourceUstring( - "scratchpadButtonLabel")); - playlistButton->set_label(*getResourceUstring( - "playlistButtonLabel")); - schedulerButton->set_label(*getResourceUstring( - "schedulerButtonLabel")); - searchButton->set_label(*getResourceUstring( - "searchButtonLabel")); - optionsButton->set_label(*getResourceUstring( - "optionsButtonLabel")); - - updateUserInfo(); - - if (!gLiveSupport->isStorageAvailable()) { - // gray out all the buttons except Options - liveModeButton->set_sensitive(false); - uploadFileButton->set_sensitive(false); - scratchpadButton->set_sensitive(false); - playlistButton->set_sensitive(false); - schedulerButton->set_sensitive(false); - searchButton->set_sensitive(false); - } -} - - -/*------------------------------------------------------------------------------ - * Set the timer - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: setTimer (void) throw () -{ - sigc::slot slot = sigc::bind(sigc::mem_fun(*this, - &MasterPanelWindow::onUpdateTime), - 0); - - // set the timer to activate every 1/somethingth of a second - timer.reset(new sigc::connection( - Glib::signal_timeout().connect(slot, 1000/updateTimeConstant))); -} - - -/*------------------------------------------------------------------------------ - * Clear the timer - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: resetTimer (void) throw () -{ - timer->disconnect(); - timer.reset(); -} - - -/*------------------------------------------------------------------------------ - * Update the timeLabel display, with the current time - *----------------------------------------------------------------------------*/ -bool -MasterPanelWindow :: onUpdateTime (int dummy) throw () -{ - Ptr::Ref now; - - if (gLiveSupport->isSchedulerAvailable()) { - try { - now = gLiveSupport->getScheduler()->getSchedulerTime(); - } catch (XmlRpcException &e) { - std::cerr << "Scheduler time is not available; " - << "switching to local time." << std::endl; - gLiveSupport->checkSchedulerClient(); - } - } else { - now = TimeConversion::now(); - } - - if (now.get()) { - time_duration dayTime = now->time_of_day(); - // get the time of day, only up to a second precision - time_duration dayTimeSec(dayTime.hours(), - dayTime.minutes(), - dayTime.seconds(), - 0); - - timeLabel->set_text(to_simple_string(dayTimeSec)); - } - - nowPlayingWidget->onUpdateTime(); - - // check on the progress of the async methods - static int backupCounter = 0; - if (backupCounter == 0) { - if (optionsWindow) { - Ptr::Ref backupList = optionsWindow->getBackupList(); - if (backupList) { - backupList->updateSilently(); - } - } - - if (searchWindow) { - searchWindow->onTimer(); - } - } - if (++backupCounter == updateTimeConstant * asyncUpdateFrequency) { - backupCounter = 0; - } - - // refresh all windows - gLiveSupport->runMainLoop(); - - // refresh the RDS display - static int rdsCounter = 0; - if (rdsCounter == 0) { - gLiveSupport->updateRds(); - } - if (++rdsCounter == updateTimeConstant * rdsUpdateFrequency) { - rdsCounter = 0; - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * The event when the Live Mode button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateLiveModeWindow (Ptr::Ref playable) - throw () -{ - if (!liveModeWindow.get()) { - liveModeWindow.reset(new LiveModeWindow(liveModeButton)); - gLiveSupport->loadWindowContents(liveModeWindow); - } - - liveModeWindow->show(); - liveModeWindow->getWindow()->present(); - - if (playable) { - liveModeWindow->addItem(playable); - } -} - - -/*------------------------------------------------------------------------------ - * The event when the upload file button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateUploadFileWindow (void) throw () -{ - if (!uploadFileWindow.get()) { - uploadFileWindow.reset(new UploadFileWindow(uploadFileButton)); - } - - uploadFileWindow->show(); - uploadFileWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * Create the Scratchpad window. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: createScratchpadWindow (void) - throw () -{ - if (!scratchpadWindow.get()) { - scratchpadWindow.reset(new ScratchpadWindow(scratchpadButton)); - gLiveSupport->loadWindowContents(scratchpadWindow); - } -} - - -/*------------------------------------------------------------------------------ - * The event when the Scratchpad button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateScratchpadWindow (Ptr::Ref playable) - throw () -{ - createScratchpadWindow(); - - if (playable) { - scratchpadWindow->addItem(playable); - } - - scratchpadWindow->show(); - scratchpadWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * The event when the Playlist button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updatePlaylistWindow (void) throw () -{ - if (!playlistWindow.get()) { - playlistWindow.reset(new PlaylistWindow(playlistButton)); - } - - playlistWindow->showContents(); - - playlistWindow->show(); - playlistWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * The event when the Scheduler button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateSchedulerWindow ( - Ptr::Ref time) - throw () -{ - if (!schedulerWindow.get()) { - try { - schedulerWindow.reset(new SchedulerWindow(schedulerButton)); - - } catch (XmlRpcException &e) { - std::cerr << e.what() << std::endl; - return; - } - } - - if (time.get()) { - schedulerWindow->setTime(time); - } - - try { - schedulerWindow->showContents(); - } catch (XmlRpcException &e) { - std::cerr << e.what() << std::endl; - return; - } - - schedulerWindow->show(); - schedulerWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * The event when the Search button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateSearchWindow (void) throw () -{ - if (!searchWindow.get()) { - searchWindow.reset(new SearchWindow(searchButton)); - } - - searchWindow->show(); - searchWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * The event when the Options button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateOptionsWindow (void) throw () -{ - if (!optionsWindow.get()) { - optionsWindow.reset(new OptionsWindow(optionsButton)); - Ptr::Ref backupList = optionsWindow->getBackupList(); - if (backupList) { - gLiveSupport->loadWindowContents(backupList.get()); - } - } - - optionsWindow->show(); - optionsWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * Show only the UI components that are visible when no one is logged in - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: showAnonymousUI (void) throw () -{ - mainButtonBox->hide(); - - if (liveModeWindow.get()) { - gLiveSupport->storeWindowContents(liveModeWindow); - if (liveModeWindow->getWindow()->is_visible()) { - liveModeWindow->hide(); - } - // the Live Mode window is not destroyed at logout, unlike the others - } - if (uploadFileWindow.get()) { - if (uploadFileWindow->getWindow()->is_visible()) { - uploadFileWindow->hide(); - } - uploadFileWindow.reset(); - } - if (scratchpadWindow.get()) { - gLiveSupport->storeWindowContents(scratchpadWindow); - if (scratchpadWindow->getWindow()->is_visible()) { - scratchpadWindow->hide(); - } - scratchpadWindow.reset(); - } - if (playlistWindow.get()) { - if (playlistWindow->getWindow()->is_visible()) { - playlistWindow->hide(); - } - playlistWindow.reset(); - } - if (schedulerWindow.get()) { - if (schedulerWindow->getWindow()->is_visible()) { - schedulerWindow->hide(); - } - schedulerWindow.reset(); - } - if (searchWindow.get()) { - if (searchWindow->getWindow()->is_visible()) { - searchWindow->hide(); - } - searchWindow.reset(); - } - if (optionsWindow.get()) { - Ptr::Ref backupList = optionsWindow->getBackupList(); - if (backupList) { - gLiveSupport->storeWindowContents(backupList.get()); - } - if (optionsWindow->getWindow()->is_visible()) { - optionsWindow->hide(); - } - optionsWindow.reset(); - } -} - - -/*------------------------------------------------------------------------------ - * Cancel the playlist edited in the PlaylistWindow, if any. - *----------------------------------------------------------------------------*/ -bool -MasterPanelWindow :: cancelEditedPlaylist (void) throw () -{ - if (playlistWindow) { - return playlistWindow->cancelPlaylist(); - } else { - return true; - } -} - - -/*------------------------------------------------------------------------------ - * Show the UI components that are visible to a specific user. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: showLoggedInUI (void) throw () -{ - mainButtonBox->show(); - - if (!gLiveSupport->isStorageAvailable()) { - liveModeButton->set_sensitive(false); - uploadFileButton->set_sensitive(false); - scratchpadButton->set_sensitive(false); - playlistButton->set_sensitive(false); - searchButton->set_sensitive(false); - } - - setSchedulerAvailable(gLiveSupport->isSchedulerAvailable()); - - if (liveModeWindow) { - liveModeWindow->updateStrings(); - if (liveModeWindow->isNotEmpty()) { - liveModeWindow->show(); - liveModeWindow->getWindow()->present(); - } - } -} - - -/*------------------------------------------------------------------------------ - * Get the next item from the top of the Live Mode window. - *----------------------------------------------------------------------------*/ -Ptr::Ref -MasterPanelWindow :: getNextItemToPlay (void) throw () -{ - if (liveModeWindow) { - return liveModeWindow->popTop(); - } else { - Ptr::Ref nullPointer; - return nullPointer; - } -} - - -/*------------------------------------------------------------------------------ - * Resize an image to fit in a box, preserving its aspect ratio. - *----------------------------------------------------------------------------*/ -void -LiveSupport::GLiveSupport:: -resizeImage (Gtk::Image* image, int width, int height) throw () -{ - Glib::RefPtr pixbuf = image->get_pixbuf(); - int imageWidth = pixbuf->get_width(); - int imageHeight = pixbuf->get_height(); - - if (imageWidth > width || imageHeight > height) { - if (imageWidth * height > imageHeight * width) { - // image is wide: squash horizontally - image->set(pixbuf->scale_simple(width, - (imageHeight * width)/imageWidth, - Gdk::INTERP_HYPER )); - } else { - // image is tall: squash vertically - image->set(pixbuf->scale_simple((imageWidth * height)/imageHeight, - height, - Gdk::INTERP_HYPER )); - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for a key pressed. - *----------------------------------------------------------------------------*/ -bool -MasterPanelWindow :: onKeyPressed (GdkEventKey * event) throw () -{ - if (event->type == GDK_KEY_PRESS) { - KeyboardShortcut::Action action = gLiveSupport->findAction( - "masterPanelWindow", - Gdk::ModifierType(event->state), - event->keyval); - switch (action) { - case KeyboardShortcut::playAudio : - - case KeyboardShortcut::pauseAudio : - nowPlayingWidget->onPlayAudio(); - return true; - - case KeyboardShortcut::stopAudio : - nowPlayingWidget->onStopAudio(); - return true; - - case KeyboardShortcut::nextTrack : - gLiveSupport->stopOutputAudio(); - gLiveSupport->onStop(); - return true; - - default : break; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * The event when the Search button has been clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: uploadToHub (Ptr::Ref playable) - throw () -{ - if (!searchWindow.get()) { - searchWindow.reset(new SearchWindow(searchButton)); - } - - searchWindow->uploadToHub(playable); - - searchWindow->show(); - searchWindow->getWindow()->present(); -} - - -/*------------------------------------------------------------------------------ - * Show or hide the Scheduler button. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: setSchedulerAvailable (bool status) throw () -{ - if (status == false) { - if (schedulerWindow && schedulerWindow->getWindow()->is_visible()) { - schedulerWindow->hide(); - } - } - - if (schedulerButton) { - schedulerButton->set_sensitive(status); - } -} - - -/*------------------------------------------------------------------------------ - * Update the cue player displays to show a stopped state. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: showCuePlayerStopped (void) throw () -{ - if (scratchpadWindow) { - scratchpadWindow->showCuePlayerStopped(); - } - - if (liveModeWindow) { - liveModeWindow->showCuePlayerStopped(); - } -} - - -/*------------------------------------------------------------------------------ - * Handle the event of the Login/Logout button being clicked. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: onLoginButtonClicked (void) throw () -{ - if (userIsLoggedIn) { - logout(); - } else { - login(); - } -} - - -/*------------------------------------------------------------------------------ - * Let the user log in. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: login (void) throw () -{ - Ptr::Ref loginWindow(new LoginWindow()); - userIsLoggedIn = loginWindow->run(); - - if (userIsLoggedIn) { - Ptr::Ref loginName = loginWindow->getLogin(); - updateUserInfo(loginName); - showLoggedInUI(); - - } else { - // TODO: display an "incorrect login" dialog - } -} - - -/*------------------------------------------------------------------------------ - * Let the user log out. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: logout (void) throw () -{ - bool userCanceledTheLogout = !gLiveSupport->logout(); - if (userCanceledTheLogout) { - return; - } - - userIsLoggedIn = false; - updateUserInfo(); -} - - -/*------------------------------------------------------------------------------ - * Show the user info and the login button. - *----------------------------------------------------------------------------*/ -void -MasterPanelWindow :: updateUserInfo (Ptr::Ref loginName) - throw () -{ - if (userIsLoggedIn) { - Ptr::Ref logoutButtonLabel; - Ptr::Ref loggedInMsg; - - logoutButtonLabel = getResourceUstring("logoutButtonLabel"); - loggedInMsg = formatMessage("loggedInMsg", *loginName); - - loginButton->set_label(*logoutButtonLabel); - userInfoLabel->set_label(*loggedInMsg); - - } else { - Ptr::Ref loginButtonLabel; - Ptr::Ref notLoggedInMsg; - - loginButtonLabel = getResourceUstring("loginButtonLabel"); - notLoggedInMsg = getResourceUstring("notLoggedInMsg"); - - loginButton->set_label(*loginButtonLabel); - userInfoLabel->set_label(*notLoggedInMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for when the user closes the master panel. - *----------------------------------------------------------------------------*/ -bool -MasterPanelWindow :: onDeleteEvent (GdkEventAny * event) throw () -{ - Gtk::ResponseType response = gLiveSupport->runNoYesDialog( - *getResourceUstring("sureToExitMsg")); - if (response != Gtk::RESPONSE_YES) { - return true; - } - - gLiveSupport->logout(); - gLiveSupport->stopOutputAudio(); - - Ptr::Ref optionsContainer - = gLiveSupport->getOptionsContainer(); - if (optionsContainer && optionsContainer->isTouched()) { - optionsContainer->writeToFile(); - } - - return false; -} - diff --git a/src/products/gLiveSupport/src/MasterPanelWindow.h b/src/products/gLiveSupport/src/MasterPanelWindow.h deleted file mode 100644 index 0bf2c45bf..000000000 --- a/src/products/gLiveSupport/src/MasterPanelWindow.h +++ /dev/null @@ -1,610 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef MasterPanelWindow_h -#define MasterPanelWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" - -#include "GuiWindow.h" -#include "GLiveSupport.h" -#include "NowPlaying.h" -#include "LiveModeWindow.h" -#include "UploadFileWindow.h" -#include "ScratchpadWindow.h" -#include "PlaylistWindow.h" -#include "SchedulerWindow.h" -#include "SearchWindow.h" -#include "OptionsWindow.h" - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The master panel window. - * - * The layout of the window is roughly the following: - *

- *  +--- master panel ---------------------------------+
- *  | + time + + now ----+ + VU meter + + radio logo + |
- *  | |      | | playing | |          | |            | |
- *  | |      | |         | +----------+ |            | |
- *  | |      | |         | + next ----+ |            | |
- *  | |      | |         | | playing  | |            | |
- *  | +------+ +---------+ +----------+ +------------+ |
- *  | +-- bottom bar --------------------------------+ |
- *  | | +-- button bar -----------+ +-- user info -+ | |
- *  | +----------------------------------------------+ |
- *  +--------------------------------------------------+
- *  
- * - * The layout of the window is contained in the file - * "var/glade/MasterPanelWindow.glade". - * - */ -class MasterPanelWindow : public GuiWindow -{ - private: - - /** - * Whether a user is currently logged in. - */ - bool userIsLoggedIn; - - /** - * Log in. - */ - void - login (void) throw (); - - /** - * Log out. - */ - void - logout (void) throw (); - - - protected: - - /** - * The time display - */ - Gtk::Label * timeLabel; - - /** - * The signal connection, that is notified by the GTK timer each - * second, and will update the time display on each wakeup. - */ - Ptr::Ref timer; - - /** - * The 'now playing' display. - */ - Ptr::Ref nowPlayingWidget; - - /** - * The button to invoke the Live Mode window. - */ - Gtk::ToggleButton * liveModeButton; - - /** - * The button to invoke the Upload File window. - */ - Gtk::ToggleButton * uploadFileButton; - - /** - * The button to invoke the Scratchpad window. - */ - Gtk::ToggleButton * scratchpadButton; - - /** - * The button to invoke the Playlist Window. - */ - Gtk::ToggleButton * playlistButton; - - /** - * The button to invoke the Scheduler Window. - */ - Gtk::ToggleButton * schedulerButton; - - /** - * The button to invoke the Search Window. - */ - Gtk::ToggleButton * searchButton; - - /** - * The button to invoke the Options window. - */ - Gtk::ToggleButton * optionsButton; - - /** - * The box containing the window opener buttons. - */ - Gtk::ButtonBox * mainButtonBox; - - /** - * The label for the "logged in as" info. - */ - Gtk::Label * userInfoLabel; - - /** - * The button to log in or log out. - */ - Gtk::Button * loginButton; - - /** - * The one and only Live Mode window. - */ - Ptr::Ref liveModeWindow; - - /** - * The one and only Upload File window. - */ - Ptr::Ref uploadFileWindow; - - /** - * The one and only Scratchpad window. - */ - Ptr::Ref scratchpadWindow; - - /** - * The one and only simple playlist management window. - */ - Ptr::Ref playlistWindow; - - /** - * The one and only scheduler window. - */ - Ptr::Ref schedulerWindow; - - /** - * The one and only search window. - */ - Ptr::Ref searchWindow; - - /** - * The one and only options window. - */ - Ptr::Ref optionsWindow; - - /** - * Function that updates timeLabel with the current time. - * This is called by GTK at regular intervals. - * - * @param dummy a dummy, unused parameter - * @return true if the timer should call this function again, - * false if the timer should be canceled - */ - virtual bool - onUpdateTime (int dummy) throw (); - - /** - * Register onUpdateTime with the GTK timer. - * - * @see #resetTimer - */ - virtual void - setTimer (void) throw (); - - /** - * Stop the timer, which was set by setTimer(). - * - * @see #setTimer - */ - virtual void - resetTimer (void) throw (); - - /** - * Function to catch the event of the file upload button being - * pressed. - */ - virtual void - onUploadFileButtonClicked (void) throw () - { - if (!uploadFileWindow || - uploadFileWindow && !uploadFileWindow->getWindow() - ->is_visible()) { - updateUploadFileWindow(); - } else { - uploadFileWindow->hide(); - } - } - - /** - * Function to catch the event of the live mode button being - * pressed. - */ - virtual void - onLiveModeButtonClicked (void) throw () - { - if (!liveModeWindow || - liveModeWindow && !liveModeWindow->getWindow() - ->is_visible()) { - updateLiveModeWindow(); - } else { - liveModeWindow->hide(); - } - } - - /** - * Function to catch the event of the Scratchpad button being - * pressed. - */ - virtual void - onScratchpadButtonClicked (void) throw () - { - if (!scratchpadWindow || - scratchpadWindow && !scratchpadWindow->getWindow() - ->is_visible()) { - updateScratchpadWindow(); - } else { - scratchpadWindow->hide(); - } - } - - /** - * Function to catch the event of the Simple Playlist - * Management button being pressed. - */ - virtual void - onPlaylistButtonClicked (void) throw () - { - if (!playlistWindow || - playlistWindow && !playlistWindow->getWindow() - ->is_visible()) { - updatePlaylistWindow(); - } else { - playlistWindow->hide(); - } - } - - /** - * Function to catch the event of the Scheduler button - * button being pressed. - */ - virtual void - onSchedulerButtonClicked (void) throw () - { - if (!schedulerWindow || - schedulerWindow && !schedulerWindow->getWindow() - ->is_visible()) { - updateSchedulerWindow(); - } else { - schedulerWindow->hide(); - } - } - - /** - * Function to catch the event of the Search button - * button being pressed. - */ - virtual void - onSearchButtonClicked (void) throw () - { - if (!searchWindow || - searchWindow && !searchWindow->getWindow() - ->is_visible()) { - updateSearchWindow(); - } else { - searchWindow->hide(); - } - } - - /** - * Function to catch the event of the Options button - * button being pressed. - */ - virtual void - onOptionsButtonClicked (void) throw () - { - if (!optionsWindow || - optionsWindow && !optionsWindow->getWindow() - ->is_visible()) { - updateOptionsWindow(); - } else { - optionsWindow->hide(); - } - } - - /** - * Function to catch the event of the Login/Logout button - * button being pressed. - */ - virtual void - onLoginButtonClicked (void) throw (); - - /** - * Signal handler for a key pressed at one of the entries. - * The keys can be customized by the keyboardShortcutContainer - * element in the gLiveSupport configuration file. - * - * The action handled is: playAudio, pauseAudio, stopAudio, - * and nextTrack. - * - * @param event the button event received - * @return true if the key press was fully handled, false if not - */ - bool - onKeyPressed (GdkEventKey * event) throw (); - - /** - * Event handler for when the user closes the master panel. - * It pops up a confirmation dialog. - * - * Overrides GuiWindow::onDeleteEvent(). - * - * @param event attributes of the event. - * @return true if handled the event, false to continue deleting. - */ - virtual bool - onDeleteEvent (GdkEventAny * event) throw (); - - - public: - - /** - * Constructor. - */ - MasterPanelWindow (void) throw (); - - /** - * Virtual destructor. - */ - virtual - ~MasterPanelWindow (void) throw (); - - /** - * Change the user interface language of the application. - * - * This is called by GLiveSupport, when its own locale changes. - * - * This method assumes that only the MasterPanelWindow is visible, - * and will only change the language of the currently open - * MasterPanelWindow. No other open windows will be affected by - * this call, but subsequently opened windows are. - */ - void - changeLanguage (void) throw (); - - /** - * Show the UI components that are visible when no one is logged in. - */ - void - showAnonymousUI (void) throw (); - - /** - * Cancel the playlist edited in the PlaylistWindow. - * - * @return true if the canceling worked (or if there was nothing - * to cancel); false if the user canceled the canceling - * @see PlaylistWindow::cancelPlaylist() - */ - bool - cancelEditedPlaylist (void) throw (); - - /** - * Show the UI components that are visible when someone is logged in. - */ - void - showLoggedInUI (void) throw (); - - /** - * Update the Live Mode window. - * - * @param playable (optional) add this item to the bottom of - * the live mode window. - */ - void - updateLiveModeWindow (Ptr::Ref playable - = Ptr::Ref()) - throw (); - - /** - * Refresh the playlist in the Live Mode window. - * Updates the playlist to the new copy supplied in the argument, - * if it is present in the Live Mode window. - * This is called by GLiveSupport::savePlaylist() after the playlist - * has been edited. - * - * @param playlist the new version of the playlist. - */ - void - refreshPlaylistInLiveMode (Ptr::Ref playlist) - throw () - { - if (liveModeWindow) { - liveModeWindow->refreshPlaylist(playlist); - } - } - - /** - * Create the Scratchpad window. - */ - void - createScratchpadWindow (void) throw (); - - /** - * Update the Upload File window. - */ - void - updateUploadFileWindow (void) throw (); - - /** - * Update the Scratchpad window. - */ - void - updateScratchpadWindow (Ptr::Ref playable - = Ptr::Ref()) - throw (); - - /** - * Update the Simple Playlist Management Window - */ - void - updatePlaylistWindow (void) throw (); - - /** - * Update the Scheduler Window, optionally to display a new time. - * - * @param time the time to display in the scheduler window. - */ - void - updateSchedulerWindow (Ptr::Ref time - = Ptr::Ref()) - throw (); - - /** - * Update the Search Window. - */ - void - updateSearchWindow (void) throw (); - - /** - * Update the Options Window - */ - void - updateOptionsWindow (void) throw (); - - /** - * Update the User info. - * - * @param loginName the login name (only when userIsLoggedIn). - */ - void - updateUserInfo (Ptr::Ref loginName - = Ptr::Ref()) - throw (); - - /** - * Get the next item from the top of the Live Mode window. - * The item is removed from the Live Mode window. - * - * @return the item at the top of the Live Mode window, a 0 pointer - * if there is no Live Mode window, or it is empty. - */ - Ptr::Ref - getNextItemToPlay (void) throw (); - - /** - * Set the "now playing" display. - * - * @param playable the Playable whose data is to be displayed. - */ - void - setNowPlaying (Ptr::Ref playable) throw () - { - nowPlayingWidget->setPlayable(playable); - gLiveSupport->updateRds(); - } - - /** - * Get the Playable currently shown in the "now playing" display. - * - * @return the currently playing item; 0 if nothing is playing. - */ - Ptr::Ref - getCurrentInnerPlayable (void) throw () - { - return nowPlayingWidget->getCurrentInnerPlayable(); - } - - /** - * Set the Playable currently shown in the "now playing" display. - * - * @return the currently playing item; 0 if nothing is playing. - */ - void - setCurrentInnerPlayable (gint64 id) throw () - { - nowPlayingWidget->setCurrentInnerPlayable(id); - } - - /** - * Upload a Playable object to the network hub. - * And display it in the Transports tab of the Search Window. - * - * @param playable the audio clip or playlist to be uploaded. - */ - void - uploadToHub (Ptr::Ref playable) throw (); - - /** - * Show or hide the Scheduler button. - * - * @param status true means show the button, false means hide. - */ - void - setSchedulerAvailable (bool status) throw (); - - /** - * Update the cue player displays to show a stopped state. - * Two cue player displays are updated by this method: - * one in the Scratchpad, and one in the Live Mode window. - */ - void - showCuePlayerStopped (void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - -/** - * Resize an image to fit in a box, preserving its aspect ratio. - * - * @param image the image to resize (modified by the method) - * @param width the width of the box - * @param height the height of the box - */ -void -resizeImage(Gtk::Image* image, int width, int height) throw (); - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // MasterPanelWindow_h - diff --git a/src/products/gLiveSupport/src/NowPlaying.cxx b/src/products/gLiveSupport/src/NowPlaying.cxx deleted file mode 100644 index 1c4c8391a..000000000 --- a/src/products/gLiveSupport/src/NowPlaying.cxx +++ /dev/null @@ -1,506 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Widgets/Colors.h" - -#include "NowPlaying.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/** - * This should be 1/4th of MasterPanelWindow::updateTimeConstant. - */ -const int blinkingConstant = 5; - -/** - * The string which identifies the Play stock image. - */ -const Glib::ustring playStockImageName = "gtk-media-play"; - -/** - * The string which identifies the Pause stock image. - */ -const Glib::ustring pauseStockImageName = "gtk-media-pause"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -NowPlaying :: NowPlaying (GuiObject * parent) - throw () - : GuiComponent(parent) -{ - glade->get_widget("playButton1", playButton); - glade->get_widget("stopButton1", stopButton); - - playButton->signal_clicked().connect(sigc::mem_fun(*this, - &NowPlaying::onPlayButtonClicked )); - stopButton->signal_clicked().connect(sigc::mem_fun(*this, - &NowPlaying::onStopButtonClicked )); - - isActive = false; - isPaused = false; - - glade->get_widget("titleLabel1", titleLabel); - glade->get_widget("creatorLabel1", creatorLabel); - glade->get_widget("elapsedTimeLabel1", elapsedTimeLabel); - glade->get_widget("remainsTimeEventBox1", remainsTimeBox); - glade->get_widget("remainsTimeLabel1", remainsTimeLabel); - glade->get_widget("playlistLabel1", playlistLabel); - setStyle(titleLabel, 14); - setStyle(creatorLabel, 8); - setStyle(elapsedTimeLabel, 16); - setStyle(remainsTimeLabel, 16); - setStyle(playlistLabel, 8); - - glade->get_widget("elapsedTimeText1", elapsedTimeText); - glade->get_widget("remainsTimeText1", remainsTimeText); - setStyle(elapsedTimeText, 7); - setStyle(remainsTimeText, 7); - elapsedTimeText->set_text(*getResourceUstring("elapsedTimeLabel")); - remainsTimeText->set_text(*getResourceUstring("remainingTimeLabel")); - - glade->get_widget("progressBar1", progressBar); - - Ptr::Ref nullPointer; - setPlayable(nullPointer); -} - - -/*------------------------------------------------------------------------------ - * Set the font and size of a label. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: setStyle (Gtk::Label * label, - int fontSize) throw () -{ - Pango::FontDescription fontDescription; - fontDescription.set_family("Bitstream Vera Sans"); - fontDescription.set_weight(Pango::WEIGHT_BOLD); - fontDescription.set_size(fontSize * Pango::SCALE); - - Pango::Attribute fontDescriptionAttribute = - Pango::Attribute::create_attr_font_desc( - fontDescription); - fontDescriptionAttribute.set_start_index(0); - fontDescriptionAttribute.set_end_index(255); - - Pango::AttrList attributeList; - attributeList.insert(fontDescriptionAttribute); - label->set_attributes(attributeList); -} - -void -NowPlaying :: setCurrentInnerPlayable (gint64 id) throw () -{ - playableMutex.lock(); - //keep this for future use - if((gint64)currentInnerPlayable->getId()->getId() != id) - { - //we are not playing a correct file, must have had an error - adjust the playlist -//std::cout << "NowPlaying :: setCurrentInnerPlayable ERROR DETECTED! called = " << id << ", current = " << (gint64)currentInnerPlayable->getId()->getId() << std::endl; - } - else{ -//std::cout << "NowPlaying :: setCurrentInnerPlayable CORRECT!" << std::endl; - } - playableMutex.unlock(); -} - -/*------------------------------------------------------------------------------ - * Set the title etc. of the playable shown in the widget. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: setPlayable (Ptr::Ref playable) throw () -{ - playableMutex.lock(); - // BEGIN synchronized block - - if (playable) { - if (!isActive || isPaused) { - playButton->set_label(pauseStockImageName); - } - playButton->set_sensitive(true); - stopButton->set_sensitive(true); - - this->playable = playable; - isActive = true; - isPaused = false; - resetRemainsTimeState(); - - remainsTimeCounter++; - if (remainsTimeCounter == 2*blinkingConstant) { - remainsTimeCounter = 0; - } - - Ptr::Ref elapsed; - try { - elapsed = gLiveSupport->getOutputAudioPosition(); - } catch (std::logic_error &e) { - elapsed.reset(new time_duration(microseconds(0))); - } - - Ptr::Ref totalLength - = TimeConversion::roundToNearestSecond( - playable->getPlaylength()); - Ptr::Ref remains(new time_duration( - *totalLength - *elapsed)); - switch (remainsTimeState) { - case TIME_GREEN : - if (*remains <= seconds(20)) { - remainsTimeState = TIME_YELLOW; - } - break; - - case TIME_YELLOW : - if (*remains <= seconds(10)) { - remainsTimeState = TIME_RED; - } - break; - - case TIME_RED : - break; - } - setRemainsTimeColor(remainsTimeState); - - Ptr::Ref innerPlayable = playable; - Ptr::Ref innerElapsed = elapsed; - Ptr::Ref innerRemains = remains; - Glib::ustring playlistInfo; - bool isFirst = true; - - while (innerPlayable->getType() == Playable::PlaylistType) { - if (isFirst) { - isFirst = false; - } else { - playlistInfo += " >>> "; - } - playlistInfo += *innerPlayable->getTitle(); - playlistInfo += " ["; - playlistInfo += *TimeConversion::timeDurationToHhMmSsString(innerRemains); - playlistInfo += "/"; - playlistInfo += *TimeConversion::timeDurationToHhMmSsString(innerPlayable->getPlaylength()); - playlistInfo += "]"; - - Ptr::Ref element = innerPlayable->getPlaylist()->findAtOffset(elapsed); - if (!element) { - break; - } - innerPlayable = element->getPlayable(); - *innerElapsed -= *element->getRelativeOffset(); - *innerRemains = *TimeConversion::roundToNearestSecond( - innerPlayable->getPlaylength()) - *innerElapsed; - } - - playlistLabel->set_text(playlistInfo); - - titleLabel->set_text(*innerPlayable->getTitle()); - - Ptr::Ref - creator = innerPlayable->getMetadata("dc:creator"); - if (creator) { - creatorLabel->set_text(*creator); - } else { - creatorLabel->set_text(""); - } - - elapsedTimeLabel->set_text(*TimeConversion::timeDurationToHhMmSsString(innerElapsed )); - remainsTimeLabel->set_text(*TimeConversion::timeDurationToHhMmSsString(innerRemains )); - - long elapsedMilliSec = innerElapsed->total_milliseconds(); - long totalMilliSec = elapsedMilliSec - + innerRemains->total_milliseconds(); - double fraction = double(elapsedMilliSec) / double(totalMilliSec); - if (fraction < 0.0) { - fraction = 0.0; // can't happen afaik - } - if (fraction > 1.0) { - fraction = 1.0; // can and does happen! - } - progressBar->set_fraction(fraction); - - currentInnerPlayable = innerPlayable; - } else { - if (isActive && !isPaused) { - playButton->set_label(playStockImageName); - isActive = false; - } - playButton->set_sensitive(false); - stopButton->set_sensitive(false); - - titleLabel->set_text(""); - creatorLabel->set_text(""); - elapsedTimeLabel->set_text(""); - remainsTimeLabel->set_text(""); - playlistLabel->set_text(""); - progressBar->set_fraction(0); - resetRemainsTimeState(); - this->playable.reset(); - this->currentInnerPlayable.reset(); - } - - // END synchronized block - playableMutex.unlock(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Play button being clicked. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: onPlayButtonClicked (void) throw () -{ - if (isActive) { - if (isPaused) { - gLiveSupport->pauseOutputAudio(); // i.e., restart - playButton->set_label(pauseStockImageName); - isPaused = false; - } else { - gLiveSupport->pauseOutputAudio(); - playButton->set_label(playStockImageName); - isPaused = true; - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Stop button being clicked. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: onStopButtonClicked (void) throw () -{ - if (isActive) { - gLiveSupport->stopOutputAudio(); // triggers a call to GLiveSupport:: - } // onStop(), which in turn calls -} // setPlayable() with a 0 argument - - -/*------------------------------------------------------------------------------ - * Update the timer displays. This is called every second by the master panel. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: onUpdateTime (void) throw () -{ - if (!isActive) { - return; - } - - remainsTimeCounter++; - if (remainsTimeCounter == 2*blinkingConstant) { - remainsTimeCounter = 0; - } - - Ptr::Ref elapsed; - try { - elapsed = gLiveSupport->getOutputAudioPosition(); - - } catch (std::logic_error &e) { - // just act as if nothing has happened - return; - } - - Ptr::Ref totalLength - = TimeConversion::roundToNearestSecond( - playable->getPlaylength()); - Ptr::Ref remains(new time_duration( - *totalLength - *elapsed)); - switch (remainsTimeState) { - case TIME_GREEN : - if (*remains <= seconds(20)) { - remainsTimeState = TIME_YELLOW; - } - break; - - case TIME_YELLOW : - if (*remains <= seconds(10)) { - remainsTimeState = TIME_RED; - } - break; - - case TIME_RED : - break; - } - setRemainsTimeColor(remainsTimeState); - - if (!playableMutex.tryLock()) { // if the 'playable' variable is being - return; // written to, then just give up for now - } - // BEGIN synchronized block - - if (!playable) { - playableMutex.unlock(); - return; - } - Ptr::Ref innerPlayable = playable; - Ptr::Ref innerElapsed = elapsed; - Ptr::Ref innerRemains = remains; - Glib::ustring playlistInfo; - bool isFirst = true; - - while (innerPlayable->getType() == Playable::PlaylistType) { - if (isFirst) { - isFirst = false; - } else { - playlistInfo += " >>> "; - } - playlistInfo += *innerPlayable->getTitle(); - playlistInfo += " ["; - playlistInfo += *TimeConversion::timeDurationToHhMmSsString( - innerRemains); - playlistInfo += "/"; - playlistInfo += *TimeConversion::timeDurationToHhMmSsString( - innerPlayable->getPlaylength()); - playlistInfo += "]"; - - Ptr::Ref element - = innerPlayable->getPlaylist() - ->findAtOffset(elapsed); - if (!element) { - break; - } - innerPlayable = element->getPlayable(); - *innerElapsed -= *element->getRelativeOffset(); - *innerRemains = *TimeConversion::roundToNearestSecond( - innerPlayable->getPlaylength()) - - *innerElapsed; - } - - playlistLabel->set_text(playlistInfo); - - titleLabel->set_text(*innerPlayable->getTitle()); - - Ptr::Ref - creator = innerPlayable->getMetadata("dc:creator"); - if (creator) { - creatorLabel->set_text(*creator); - } else { - creatorLabel->set_text(""); - } - - elapsedTimeLabel->set_text(*TimeConversion::timeDurationToHhMmSsString( - innerElapsed )); - remainsTimeLabel->set_text(*TimeConversion::timeDurationToHhMmSsString( - innerRemains )); - - long elapsedMilliSec = innerElapsed->total_milliseconds(); - long totalMilliSec = elapsedMilliSec - + innerRemains->total_milliseconds(); - double fraction = double(elapsedMilliSec) / double(totalMilliSec); - if (fraction < 0.0) { - fraction = 0.0; // can't happen afaik - } - if (fraction > 1.0) { - fraction = 1.0; // can and does happen! - } - progressBar->set_fraction(fraction); - - currentInnerPlayable = innerPlayable; - - // END synchronized block - playableMutex.unlock(); -} - - -/*------------------------------------------------------------------------------ - * Set the background color of the "remains time" label. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: setRemainsTimeColor (RemainsTimeStateType state) throw () -{ - bool isBlinkOn = (remainsTimeCounter < blinkingConstant); - - if (isBlinkOn) { - switch (state) { - case TIME_GREEN: - remainsTimeBox->unset_bg(Gtk::STATE_NORMAL); - break; - - case TIME_YELLOW: - remainsTimeBox->modify_bg(Gtk::STATE_NORMAL, - Colors::getColor(Colors::Yellow)); - break; - - case TIME_RED: - remainsTimeBox->modify_bg(Gtk::STATE_NORMAL, - Colors::getColor(Colors::Red)); - break; - } - } else { - remainsTimeBox->unset_bg(Gtk::STATE_NORMAL); - } - - gLiveSupport->runMainLoop(); -} - - -/*------------------------------------------------------------------------------ - * Reset all remains-time-blinking related variables. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: resetRemainsTimeState (void) throw () -{ - remainsTimeState = TIME_GREEN; - remainsTimeCounter = 0; - setRemainsTimeColor(TIME_GREEN); -} - - -/*------------------------------------------------------------------------------ - * Change the language of the widget. - *----------------------------------------------------------------------------*/ -void -NowPlaying :: changeLanguage (void) - throw () -{ - setBundle(parent->getBundle()); - - elapsedTimeText->set_text(*getResourceUstring("elapsedTimeLabel")); - remainsTimeText->set_text(*getResourceUstring("remainingTimeLabel")); -} - - diff --git a/src/products/gLiveSupport/src/NowPlaying.h b/src/products/gLiveSupport/src/NowPlaying.h deleted file mode 100644 index 75bbaaf29..000000000 --- a/src/products/gLiveSupport/src/NowPlaying.h +++ /dev/null @@ -1,318 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef NowPlaying_h -#define NowPlaying_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Mutex.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The box displaying "now playing" in the master panel. - * - */ -class NowPlaying : public GuiComponent -{ - private: - - /** - * Whether anything is shown in the widget. - */ - bool isActive; - - /** - * Whether the pause button has been clicked. - */ - bool isPaused; - - /** - * The item which is currently playing (audio clip or playlist). - */ - Ptr::Ref playable; - - /** - * The audio clip which is currently playing (could be nested - * several levels inside the "playable" object). - */ - Ptr::Ref currentInnerPlayable; - - /** - * The label holding the title of the now playing item. - */ - Gtk::Label * titleLabel; - - /** - * The label holding the creator of the now playing item. - */ - Gtk::Label * creatorLabel; - - /** - * The label holding the playlist containing the audio clip - * which is playing now (if any). - */ - Gtk::Label * playlistLabel; - - /** - * The progress bar. - */ - Gtk::ProgressBar * progressBar; - - /** - * The label which says "elapsed time". - */ - Gtk::Label * elapsedTimeText; - - /** - * The label holding the elapsed time. - */ - Gtk::Label * elapsedTimeLabel; - - /** - * The label which says "remaining time". - */ - Gtk::Label * remainsTimeText; - - /** - * The label holding the remaining time. - */ - Gtk::Label * remainsTimeLabel; - - /** - * A box around the remaining time label, so we can modify its color. - */ - Gtk::EventBox * remainsTimeBox; - - /** - * The play button. - */ - Gtk::Button * playButton; - - /** - * The stop button. - */ - Gtk::Button * stopButton; - - /** - * The possible states of the 'time remains' label. - */ - typedef enum { TIME_GREEN, TIME_YELLOW, TIME_RED } - RemainsTimeStateType; - - /** - * The current state of the 'time remains' label. - */ - RemainsTimeStateType remainsTimeState; - - /** - * Counter which makes the 'time remains' label blink. - */ - int remainsTimeCounter; - - /** - * A mutex to make the writing, and some reading, of the - * 'playable' variable atomic. - */ - Mutex playableMutex; - - /** - * Default constructor. - */ - NowPlaying (void) throw (); - - /** - * Event handler for the Play button being clicked. - */ - void - onPlayButtonClicked (void) throw (); - - /** - * Event handler for the Stop button being clicked. - */ - void - onStopButtonClicked (void) throw (); - - /** - * Set the color of the 'remains time' label. - * - * It sets the background color of the label to blue, yellow or red, - * depending on the remainsTimeState and the remainsTimeCounter - * variables. - * - * @param state the new state of the label. - */ - void - setRemainsTimeColor (RemainsTimeStateType state) - throw (); - - /** - * Reset all remains-time-blinking related variables. - * - * Sets remainsTimeState to TIME_GREEN, remainsTimeCounter to 0, - * and the background color of the label to blue. - */ - void inline - resetRemainsTimeState (void) throw (); - - /** - * Sets the font and size of the label. - * - * @param label the label the style of which we want to set. - * @param fontSize the font size for the label. - */ - void - setStyle (Gtk::Label * label, - int fontSize) - throw (); - - - public: - - /** - * Constructor with parent and localization parameter. - * - * @param parent the GuiObject which contains this one. - */ - NowPlaying (GuiObject * parent) - throw (); - - /** - * A virtual destructor. - */ - virtual - ~NowPlaying (void) throw () - { - } - - /** - * Set the title etc. of the now playing item. - * - * @param playable the playable to be displayed - */ - void - setPlayable (Ptr::Ref playable) throw (); - - /** - * Function that updates the elapsed and remaining time displays. - * This is called by the MasterPanelWindow every second. - */ - void - onUpdateTime (void) throw (); - - /** - * Public interface for restarting the audio. - * - * This is used by MasterPanelWindow::onKeyPressed(). - */ - void - onPlayAudio (void) throw () - { - onPlayButtonClicked(); - } - - /** - * Public interface for stopping the audio. - * - * This is used by MasterPanelWindow::onKeyPressed(). - */ - void - onStopAudio (void) throw () - { - onStopButtonClicked(); - } - - /** - * Get the Playable object which is playing now. - * If a playlist is playing, does not return the playlist, but - * the audio clip inside the playlist (possibly several levels deep). - * - * This is used by GLiveSupport::substituteRdsData(). - * - * @return the currently playing item; 0 if nothing is playing. - */ - Ptr::Ref - getCurrentInnerPlayable (void) throw () - { - return currentInnerPlayable; - } - - /** - * Set the Playable object which is playing now. - * If a playlist is playing, does not return the playlist, but - * the audio clip inside the playlist (possibly several levels deep). - * - * This is used by GLiveSupport::substituteRdsData(). - * - * @return void - */ - void - setCurrentInnerPlayable (gint64 id) throw (); - - /** - * Change the user interface language of the widget. - * - * This is called by the parent when its locale has changed; - * NowPlaying then updates its own bundle to match the parent's. - */ - void - changeLanguage (void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // NowPlaying_h - diff --git a/src/products/gLiveSupport/src/OptionsWindow.cxx b/src/products/gLiveSupport/src/OptionsWindow.cxx deleted file mode 100644 index 49046e529..000000000 --- a/src/products/gLiveSupport/src/OptionsWindow.cxx +++ /dev/null @@ -1,785 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "OptionsWindow.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "optionsWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "OptionsWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -OptionsWindow :: OptionsWindow (Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton) -{ - bool canBackup = (gLiveSupport->getSessionId() - && gLiveSupport->isStorageAvailable()); - - // build up the notepad for the various sections - glade->get_widget("mainNotebook1", mainNotebook); - constructSoundSection(); - constructKeyBindingsSection(); - constructServersSection(); - constructSchedulerSection(); - if (canBackup) { - constructBackupSection(); - } - constructRdsSection(); - constructAboutSection(); - - Gtk::Label * soundTabLabel; - Gtk::Label * keyBindingsTabLabel; - Gtk::Label * serversTabLabel; - Gtk::Label * schedulerTabLabel; - Gtk::Label * backupTabLabel; - Gtk::Label * rdsTabLabel; - Gtk::Label * aboutTabLabel; - glade->get_widget("soundTabLabel1", soundTabLabel); - glade->get_widget("keyBindingsTabLabel1", keyBindingsTabLabel); - glade->get_widget("serversTabLabel1", serversTabLabel); - glade->get_widget("schedulerTabLabel1", schedulerTabLabel); - glade->get_widget("backupTabLabel1", backupTabLabel); - glade->get_widget("rdsTabLabel1", rdsTabLabel); - glade->get_widget("aboutTabLabel1", aboutTabLabel); - soundTabLabel->set_label(*getResourceUstring("soundSectionLabel")); - keyBindingsTabLabel->set_label(*getResourceUstring( - "keyBindingsSectionLabel")); - serversTabLabel->set_label(*getResourceUstring("serversSectionLabel")); - schedulerTabLabel->set_label(*getResourceUstring("schedulerSectionLabel")); - if (canBackup) { - backupTabLabel->set_label(*getResourceUstring("backupSectionLabel")); - } - rdsTabLabel->set_label(*getResourceUstring("rdsSectionLabel")); - aboutTabLabel->set_label(*getResourceUstring("aboutSectionLabel")); - - // bind events - glade->connect_clicked("applyButton1", sigc::mem_fun(*this, - &OptionsWindow::onApplyButtonClicked)); - glade->connect_clicked("cancelButton1", sigc::mem_fun(*this, - &OptionsWindow::onCancelButtonClicked)); - glade->connect_clicked("okButton1", sigc::mem_fun(*this, - &OptionsWindow::onOkButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Cancel button. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onCancelButtonClicked(void) throw () -{ - resetEntries(); - resetKeyBindings(); - resetRds(); - onCloseButtonClicked(false); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Apply button. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onApplyButtonClicked(void) throw () -{ - bool changed = saveChangesInStringEntryFields(); - saveChangesInKeyBindings(); // no need to restart - saveChangesInRds(); // no need to restart - - if (changed) { - gLiveSupport->displayMessageWindow(*getResourceUstring( - "needToRestartMsg")); - } -} - - -/*------------------------------------------------------------------------------ - * Save the changes in the string entry fields. - *----------------------------------------------------------------------------*/ -bool -OptionsWindow :: saveChangesInStringEntryFields(void) throw () -{ - Ptr::Ref - optionsContainer = gLiveSupport->getOptionsContainer(); - - bool changed = false; - StringEntryListType::const_iterator it; - for (it = stringEntryList.begin(); it != stringEntryList.end(); ++it) { - - OptionsContainer::OptionItemString optionItem = it->first; - Gtk::Entry * entry = it->second; - - Ptr::Ref - oldValue = optionsContainer->getOptionItem(optionItem); - Ptr::Ref - newValue(new Glib::ustring(entry->get_text())); - - if (*oldValue != *newValue) { - try { - optionsContainer->setOptionItem(optionItem, newValue); - changed = true; - } catch (std::invalid_argument &e) { - try { - Ptr::Ref - errorMessage(new Glib::ustring( - *getResourceUstring("errorMsg") )); - errorMessage->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMessage); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - std::exit(1); - } - } - } - } - - return changed; -} - - -/*------------------------------------------------------------------------------ - * Save the changes in the key bindings. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: saveChangesInKeyBindings(void) throw () -{ - Ptr::Ref - optionsContainer = gLiveSupport->getOptionsContainer(); - Ptr::Ref - list = gLiveSupport->getKeyboardShortcutList(); - - KeyboardShortcutList::iterator listIt; - Gtk::TreeModel::iterator modelIt = keyBindingsModel - ->children().begin(); - int containerNo = 1; - for (listIt = list->begin(); listIt != list->end(); - ++listIt, ++modelIt, ++containerNo) { - Ptr::Ref - container = *listIt; - Gtk::TreeRow parent = *modelIt; - - KeyboardShortcutContainer::iterator containerIt; - Gtk::TreeModel::iterator childIt = parent.children() - .begin(); - int shortcutNo = 1; - for (containerIt = container->begin(); containerIt != container->end(); - ++containerIt, ++childIt, ++shortcutNo) { - Ptr::Ref - shortcut = *containerIt; - Ptr::Ref - oldKeyString = shortcut->getKeyString(); - Gtk::TreeRow child = *childIt; - Ptr::Ref - newKeyString(new const Glib::ustring( - child[keyBindingsColumns.keyNameColumn] )); - if (*oldKeyString != *newKeyString) { - try { - shortcut->setKey(*newKeyString); - optionsContainer->setKeyboardShortcutItem(containerNo, - shortcutNo, - newKeyString); - } catch (std::invalid_argument &e) { - try { - Ptr::Ref - errorMessage(new Glib::ustring( - *getResourceUstring("errorMsg") )); - errorMessage->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMessage); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - std::exit(1); - } - } - } - } - } -} - - -/*------------------------------------------------------------------------------ - * Save the changes in the RDS settings. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: saveChangesInRds(void) throw () -{ - rdsView->saveChanges(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the OK button. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onOkButtonClicked(void) throw () -{ - onApplyButtonClicked(); - onCloseButtonClicked(false); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Close button. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onCloseButtonClicked(bool needConfirm) throw () -{ - if (needConfirm) { - // TODO: add confirmation dialog - // and either save changes or cancel them - } - - hide(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the test button - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onTestButtonClicked(const Gtk::Entry * entry) - throw () -{ - Ptr::Ref optionsContainer - = gLiveSupport->getOptionsContainer(); - - Ptr::Ref - oldDevice = optionsContainer->getOptionItem(OptionsContainer:: - cuePlayerDeviceName); - Ptr::Ref - newDevice(new Glib::ustring(entry->get_text())); - - // NOTE: we can't use the output player b/c that would trigger onStop() - gLiveSupport->playTestSoundOnCue(oldDevice, newDevice); -} - - -/*------------------------------------------------------------------------------ - * Create a new user entry field item. - *----------------------------------------------------------------------------*/ -Gtk::Entry * -OptionsWindow :: createEntry(const Glib::ustring & entryName, - OptionsContainer::OptionItemString optionItem) - throw () -{ - Ptr::Ref optionsContainer - = gLiveSupport->getOptionsContainer(); - - Gtk::Entry * entry; - glade->get_widget(entryName, entry); - - try { - entry->set_text(*optionsContainer->getOptionItem(optionItem)); - - } catch (std::invalid_argument &e) { - // TODO: signal error? - entry->set_text(""); - } - - stringEntryList.push_back(std::make_pair(optionItem, entry)); - - return entry; -} - - -/*------------------------------------------------------------------------------ - * Construct the "Sound" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructSoundSection(void) throw () -{ - Ptr::Ref optionsContainer - = gLiveSupport->getOptionsContainer(); - - Gtk::Label * cueDeviceLabel; - Gtk::Label * outputDeviceLabel; - glade->get_widget("cueDeviceLabel1", cueDeviceLabel); - glade->get_widget("outputDeviceLabel1", outputDeviceLabel); - cueDeviceLabel->set_label(*getResourceUstring("cueDeviceLabel")); - outputDeviceLabel->set_label(*getResourceUstring("outputDeviceLabel")); - - Gtk::Entry * cueDeviceEntry; - Gtk::Entry * outputDeviceEntry; - cueDeviceEntry = createEntry("cueDeviceEntry1", - OptionsContainer::cuePlayerDeviceName); - outputDeviceEntry = createEntry("outputDeviceEntry1", - OptionsContainer::outputPlayerDeviceName); - - Gtk::Button * cueTestButton; - Gtk::Button * outputTestButton; - glade->get_widget("cueTestButton1", cueTestButton); - glade->get_widget("outputTestButton1", outputTestButton); - cueTestButton->set_label(*getResourceUstring("testButtonLabel")); - outputTestButton->set_label(*getResourceUstring("testButtonLabel")); - cueTestButton->signal_clicked().connect(sigc::bind( - sigc::mem_fun(*this, &OptionsWindow::onTestButtonClicked), - cueDeviceEntry)); - outputTestButton->signal_clicked().connect(sigc::bind( - sigc::mem_fun(*this, &OptionsWindow::onTestButtonClicked), - outputDeviceEntry)); -} - - -/*------------------------------------------------------------------------------ - * Construct the "Key bindings" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructKeyBindingsSection(void) throw () -{ - // create the TreeView - keyBindingsModel = Gtk::TreeStore::create(keyBindingsColumns); - glade->get_widget_derived("keyBindingsTreeView1", keyBindingsTreeView); - keyBindingsTreeView->set_model(keyBindingsModel); - keyBindingsTreeView->connectModelSignals(keyBindingsModel); - - keyBindingsTreeView->appendColumn("", keyBindingsColumns.actionColumn); - keyBindingsTreeView->appendColumn("", keyBindingsColumns.keyDisplayColumn); - - fillKeyBindingsModel(); - - keyBindingsTreeView->columns_autosize(); - keyBindingsTreeView->expand_all(); - - // connect the callbacks - keyBindingsTreeView->signal_row_activated().connect(sigc::mem_fun(*this, - &OptionsWindow::onKeyBindingsRowActivated)); - keyBindingsTreeView->signal_key_press_event().connect(sigc::mem_fun(*this, - &OptionsWindow::onKeyBindingsKeyPressed)); - keyBindingsTreeView->signal_focus_out_event().connect_notify(sigc::mem_fun( - *this, - &OptionsWindow::onKeyBindingsFocusOut)); - - // add instructions - Gtk::Label * instructionsLabel; - glade->get_widget("keyBindingsInstructionsLabel1", instructionsLabel); - instructionsLabel->set_label(*getResourceUstring( - "keyBindingsInstructionsText")); -} - - -/*------------------------------------------------------------------------------ - * Fill the key bindings model from the KeyboardShortcutList. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: fillKeyBindingsModel(void) throw () -{ - Ptr::Ref - list = gLiveSupport->getKeyboardShortcutList(); - - KeyboardShortcutList::iterator it; - for (it = list->begin(); it != list->end(); ++it) { - Ptr::Ref - container = *it; - Ptr::Ref - windowName = container->getWindowName(); - Gtk::TreeRow parent = *keyBindingsModel->append(); - parent[keyBindingsColumns.actionColumn] - = *gLiveSupport->getLocalizedWindowName(windowName); - - KeyboardShortcutContainer::iterator iter; - for (iter = container->begin(); iter != container->end(); ++iter) { - Ptr::Ref - shortcut = *iter; - Ptr::Ref - actionString = shortcut->getActionString(); - Ptr::Ref - keyString = shortcut->getKeyString(); - Gtk::TreeRow child - = *keyBindingsModel->append(parent.children()); - child[keyBindingsColumns.actionColumn] - = *gLiveSupport->getLocalizedKeyboardActionName( - actionString); - child[keyBindingsColumns.keyNameColumn] - = *keyString; // TODO: localize this? - child[keyBindingsColumns.keyDisplayColumn] - = Glib::Markup::escape_text(*keyString); - } - } -} - - -/*------------------------------------------------------------------------------ - * Construct the "Servers" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructServersSection(void) throw () -{ - Ptr::Ref optionsContainer - = gLiveSupport->getOptionsContainer(); - - // authentication server - Gtk::Label * authenticationLabel; - Gtk::Label * authenticationServerLabel; - Gtk::Label * authenticationPortLabel; - Gtk::Label * authenticationPathLabel; - glade->get_widget("authenticationServerLabel1", authenticationLabel); - glade->get_widget("authenticationServerServerLabel1", - authenticationServerLabel); - glade->get_widget("authenticationServerPortLabel1", - authenticationPortLabel); - glade->get_widget("authenticationServerPathLabel1", - authenticationPathLabel); - authenticationLabel->set_label(*getResourceUstring("authenticationLabel")); - authenticationServerLabel->set_label(*getResourceUstring("serverLabel")); - authenticationPortLabel->set_label(*getResourceUstring("portLabel")); - authenticationPathLabel->set_label(*getResourceUstring("pathLabel")); - - createEntry("authenticationServerServerEntry1", - OptionsContainer::authenticationServer); - createEntry("authenticationServerPortEntry1", - OptionsContainer::authenticationPort); - createEntry("authenticationServerPathEntry1", - OptionsContainer::authenticationPath); - - // storage server - Gtk::Label * storageLabel; - Gtk::Label * storageServerLabel; - Gtk::Label * storagePortLabel; - Gtk::Label * storagePathLabel; - glade->get_widget("storageServerLabel1", storageLabel); - glade->get_widget("storageServerServerLabel1", storageServerLabel); - glade->get_widget("storageServerPortLabel1", storagePortLabel); - glade->get_widget("storageServerPathLabel1", storagePathLabel); - storageLabel->set_label(*getResourceUstring("storageLabel")); - storageServerLabel->set_label(*getResourceUstring("serverLabel")); - storagePortLabel->set_label(*getResourceUstring("portLabel")); - storagePathLabel->set_label(*getResourceUstring("pathLabel")); - - createEntry("storageServerServerEntry1", OptionsContainer::storageServer); - createEntry("storageServerPortEntry1", OptionsContainer::storagePort); - createEntry("storageServerPathEntry1", OptionsContainer::storagePath); - - // scheduler server - Gtk::Label * schedulerLabel; - Gtk::Label * schedulerServerLabel; - Gtk::Label * schedulerPortLabel; - Gtk::Label * schedulerPathLabel; - glade->get_widget("schedulerServerLabel1", schedulerLabel); - glade->get_widget("schedulerServerServerLabel1", schedulerServerLabel); - glade->get_widget("schedulerServerPortLabel1", schedulerPortLabel); - glade->get_widget("schedulerServerPathLabel1", schedulerPathLabel); - schedulerLabel->set_label(*getResourceUstring("schedulerLabel")); - schedulerServerLabel->set_label(*getResourceUstring("serverLabel")); - schedulerPortLabel->set_label(*getResourceUstring("portLabel")); - schedulerPathLabel->set_label(*getResourceUstring("pathLabel")); - - createEntry("schedulerServerServerEntry1", - OptionsContainer::schedulerServer); - createEntry("schedulerServerPortEntry1", OptionsContainer::schedulerPort); - createEntry("schedulerServerPathEntry1", OptionsContainer::schedulerPath); -} - - -/*------------------------------------------------------------------------------ - * Construct the "Scheduler" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructSchedulerSection(void) throw () -{ - Gtk::Label * schedulerTextLabel; - Gtk::Button * startButton; - Gtk::Button * stopButton; - glade->get_widget("schedulerTextLabel1", schedulerTextLabel); - glade->get_widget("schedulerStatusLabel1", schedulerStatusLabel); - glade->get_widget("schedulerStartButton1", startButton); - glade->get_widget("schedulerStopButton1", stopButton); - schedulerTextLabel->set_label(*getResourceUstring("schedulerStatusText")); - updateSchedulerStatus(); // sets the schedulerStatusLabel - startButton->set_label(*getResourceUstring("schedulerStartButtonLabel")); - stopButton->set_label(*getResourceUstring("schedulerStopButtonLabel")); - - startButton->signal_clicked().connect(sigc::mem_fun(*this, - &OptionsWindow::onSchedulerStartButtonClicked)); - stopButton->signal_clicked().connect(sigc::mem_fun(*this, - &OptionsWindow::onSchedulerStopButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Construct the "Backup" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructBackupSection(void) throw () -{ - backupView.reset(new BackupView(this)); -} - - -/*------------------------------------------------------------------------------ - * Construct the "RDS" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructRdsSection(void) throw () -{ - rdsView.reset(new RdsView(this)); -} - - -/*------------------------------------------------------------------------------ - * Construct the "About" section. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: constructAboutSection(void) throw () -{ - Glib::ustring aboutLabelContents; - - aboutLabelContents.append("\n"); - aboutLabelContents.append(PACKAGE_NAME); - aboutLabelContents.append(" "); - aboutLabelContents.append(PACKAGE_VERSION); - aboutLabelContents.append("\n\n"); - aboutLabelContents.append(*formatMessage("reportBugsToText", - PACKAGE_BUGREPORT )); - aboutLabelContents.append("\n\n"); - aboutLabelContents.append(*getBinaryResourceAsUstring("creditsText")); - - Gtk::Label * aboutLabel; - glade->get_widget("aboutLabel1", aboutLabel); - aboutLabel->set_label(aboutLabelContents); -} - - -/*------------------------------------------------------------------------------ - * Reset all user entries to their saved state. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: resetEntries() throw () -{ - Ptr::Ref optionsContainer - = gLiveSupport->getOptionsContainer(); - - StringEntryListType::iterator it; - for (it = stringEntryList.begin(); it != stringEntryList.end(); ++it) { - OptionsContainer::OptionItemString optionItem = it->first; - Gtk::Entry * entry = it->second; - - try { - entry->set_text(*optionsContainer->getOptionItem(optionItem)); - - } catch (std::invalid_argument &e) { - // TODO: signal error? - entry->set_text(""); - } - } -} - - -/*------------------------------------------------------------------------------ - * Reset the key bindings to their saved state. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: resetKeyBindings(void) throw () -{ - keyBindingsModel->clear(); - fillKeyBindingsModel(); - keyBindingsTreeView->expand_all(); -} - - -/*------------------------------------------------------------------------------ - * Reset the RDS settings to their saved state. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: resetRds(void) throw () -{ - rdsView->reset(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for clicking on a row in the key bindings table. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onKeyBindingsRowActivated(const Gtk::TreePath & path, - Gtk::TreeViewColumn * column) - throw () -{ - resetEditedKeyBinding(); - - Gtk::TreeIter iter = keyBindingsModel->get_iter(path); - if (iter) { - Gtk::TreeRow row = *iter; - editedKeyName.reset(new const Glib::ustring( - row[keyBindingsColumns.keyNameColumn])); - editedKeyRow = row; - row[keyBindingsColumns.keyDisplayColumn] - = *getResourceUstring("pressAKeyMsg"); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for clicking outside the key bindings table. - *----------------------------------------------------------------------------*/ -bool -OptionsWindow :: onKeyBindingsKeyPressed(GdkEventKey * event) throw () -{ - // TODO: remove this ugly hack - switch (event->keyval) { - case GDK_Shift_L : // ignore the event if only - case GDK_Shift_R : // a shift key has been pressed - case GDK_Control_L : - case GDK_Control_R : - case GDK_Alt_L : - case GDK_Alt_R : - case GDK_Super_L : - case GDK_Super_R : - case GDK_Hyper_L : - case GDK_Hyper_R : - case GDK_Meta_L : - case GDK_Meta_R : return false; - } - - if (editedKeyName) { - Ptr::Ref - newKeyName = KeyboardShortcut::modifiedKeyToString( - Gdk::ModifierType(event->state), - event->keyval); - if (newKeyName && *newKeyName != "Escape") { - editedKeyName = newKeyName; - } - resetEditedKeyBinding(); - return true; - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Event handler for clicking outside the key bindings table. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onKeyBindingsFocusOut(GdkEventFocus * event) - throw () -{ - resetEditedKeyBinding(); -} - - -/*------------------------------------------------------------------------------ - * Reset the key binding to its pre-editing value. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: resetEditedKeyBinding(void) throw () -{ - if (editedKeyName) { - editedKeyRow[keyBindingsColumns.keyNameColumn] - = *editedKeyName; - editedKeyRow[keyBindingsColumns.keyDisplayColumn] - = Glib::Markup::escape_text(*editedKeyName); - editedKeyName.reset(); - } -} - - -/*------------------------------------------------------------------------------ - * Show the window and return when the user hides it. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: run(void) throw () -{ - mainNotebook->set_current_page(2); // "Servers" - mainWindow->property_window_position().set_value( - Gtk::WIN_POS_CENTER_ALWAYS); - mainWindow->show_all(); - Gtk::Main::run(*mainWindow); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the scheduler Start button getting clicked. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onSchedulerStartButtonClicked(void) throw () -{ - gLiveSupport->checkSchedulerClient(); - if (!gLiveSupport->isSchedulerAvailable()) { - gLiveSupport->startSchedulerClient(); - } - updateSchedulerStatus(); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the scheduler Stop button getting clicked. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: onSchedulerStopButtonClicked(void) throw () -{ - gLiveSupport->checkSchedulerClient(); - if (gLiveSupport->isSchedulerAvailable()) { - gLiveSupport->stopSchedulerClient(); - } - updateSchedulerStatus(); -} - - -/*------------------------------------------------------------------------------ - * Update the status display in the Status tab. - *----------------------------------------------------------------------------*/ -void -OptionsWindow :: updateSchedulerStatus(void) throw () -{ - gLiveSupport->checkSchedulerClient(); - if (gLiveSupport->isSchedulerAvailable()) { - schedulerStatusLabel->set_text( - *getResourceUstring("schedulerRunningStatus")); - } else { - schedulerStatusLabel->set_text( - *getResourceUstring("schedulerStoppedStatus")); - } -} - diff --git a/src/products/gLiveSupport/src/OptionsWindow.h b/src/products/gLiveSupport/src/OptionsWindow.h deleted file mode 100644 index e90522e4d..000000000 --- a/src/products/gLiveSupport/src/OptionsWindow.h +++ /dev/null @@ -1,434 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef OptionsWindow_h -#define OptionsWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Core/OptionsContainer.h" -#include "LiveSupport/Widgets/ComboBoxText.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "GuiWindow.h" -#include "GLiveSupport.h" -#include "BackupView.h" -#include "RdsView.h" - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The options window. - * - * The layout of the window is roughly the following: - *

- *  +--- options window ----------------+
- *  | +- tab1 -+ ... +- tabN -+         |
- *  | +-------------------------------+ |
- *  | +-- contents of the ------------+ |
- *  | +-- currently ------------------+ |
- *  | +-- selected tab ---------------+ |
- *  | +-------------------------------+ |
- *  +------------(Apply)-(Cancel)-(OK)--+
- *  
- * - */ -class OptionsWindow : public GuiWindow -{ - private: - - /** - * The notepad holding the different sections. - */ - Gtk::Notebook * mainNotebook; - - /** - * The label showing the current status of the scheduler. - */ - Gtk::Label * schedulerStatusLabel; - - /** - * The type for the list of user entry fields of string type. - */ - typedef std::vector > StringEntryListType; - - /** - * The list of user entry fields of string type. - */ - StringEntryListType stringEntryList; - - /** - * Create a new user entry field item. - * - * This gets a reference to the Gtk::Entry from the Glade file, and - * sets its text to the current value of the option. - * The Gtk::Entry is then added to the list of user entry fields. - * - * @param entryName the name of the Entry in the Glade file. - * @param optionItem the name of the option item for this entry. - * @return the text entry field just processed. - */ - Gtk::Entry * - createEntry(const Glib::ustring & entryName, - OptionsContainer::OptionItemString optionItem) - throw (); - - /** - * Reset all user entries to their saved state. - */ - void - resetEntries(void) throw (); - - /** - * Reset the key bindings to their saved state. - */ - void - resetKeyBindings(void) throw (); - - /** - * Reset the RDS settings to their saved state. - */ - void - resetRds(void) throw (); - - /** - * Fill the key bindings model from the KeyboardShortcutList. - */ - void - fillKeyBindingsModel(void) throw (); - - /** - * The row of the currently edited key binding. - */ - Gtk::TreeRow editedKeyRow; - - /** - * The value of the currently edited key binding - * (as a user-readable modifiers - key name combo). - */ - Ptr::Ref editedKeyName; - - /** - * Reset the key binding to its pre-editing value. - */ - void - resetEditedKeyBinding(void) throw (); - - /** - * Save the changes in the string entry fields. - * - * @return true if some changes were detected and saved. - */ - bool - saveChangesInStringEntryFields(void) throw (); - - /** - * Save the changes in the key bindings. - */ - void - saveChangesInKeyBindings(void) throw (); - - /** - * Save the changes in the RDS settings. - */ - void - saveChangesInRds(void) throw (); - - /** - * Construct the "Sound" section. - */ - void - constructSoundSection(void) throw (); - - /** - * Construct the "Key bindings" section. - */ - void - constructKeyBindingsSection(void) throw (); - - /** - * Construct the "Servers" section. - */ - void - constructServersSection(void) throw (); - - /** - * Construct the "Scheduler" section. - * This section contains the scheduler start and stop buttons. - */ - void - constructSchedulerSection(void) throw (); - - /** - * Construct the "Backup" section. - */ - void - constructBackupSection(void) throw (); - - /** - * Construct the "RDS" section. - */ - void - constructRdsSection(void) throw (); - - /** - * Construct the "About" section. - */ - void - constructAboutSection(void) throw (); - - /** - * Update the scheduler status display in the Scheduler tab. - */ - void - updateSchedulerStatus(void) throw (); - - - protected: - - /** - * Event handler for the Cancel button. - */ - virtual void - onCancelButtonClicked(void) throw (); - - /** - * Event handler for the Apply button. - */ - virtual void - onApplyButtonClicked(void) throw (); - - /** - * Event handler for the OK button. - */ - virtual void - onOkButtonClicked(void) throw (); - - /** - * Event handler for the Close button. - * - * @param needConfirm if true, we check if changes has been - * made to the input fields, and if yes, then - * a "save changes?" dialog is displayed - */ - virtual void - onCloseButtonClicked(bool needConfirm = true) throw (); - - /** - * Event handler for the test button. - * - * @param entry the text entry field containing the new device name - * @see GLiveSupport::setCueAudioDevice() - * @see GLiveSupport::playTestSoundOnCue() - */ - virtual void - onTestButtonClicked(const Gtk::Entry * entry) throw (); - - /** - * Event handler for double-clicking a row in the key bindings table. - * - * @param event the button event - */ - virtual void - onKeyBindingsRowActivated(const Gtk::TreePath & path, - Gtk::TreeViewColumn * column) - throw (); - - /** - * Signal handler for a key pressed in the key bindings table. - * - * @param event the button event received - * @return true if the key press was fully handled, false if not - */ - virtual bool - onKeyBindingsKeyPressed(GdkEventKey * event) throw (); - - /** - * Event handler for clicking outside the key bindings table. - * - * @param event the focus event - */ - virtual void - onKeyBindingsFocusOut(GdkEventFocus * event) throw (); - - /** - * Signal handler for the scheduler Start button getting clicked. - */ - virtual void - onSchedulerStartButtonClicked(void) throw (); - - /** - * Signal handler for the scheduler Stop button getting clicked. - */ - virtual void - onSchedulerStopButtonClicked(void) throw (); - - /** - * The columns model containing the data for the Key bindings section. - * - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - - /** - * The column for the name of the action. - * This contains the name of the window (for parent rows), - * or the name of the action (for child rows). - */ - Gtk::TreeModelColumn actionColumn; - - /** - * The column for the user readable name of the key bound - * (plain version, with '<' and '>'). - */ - Gtk::TreeModelColumn keyNameColumn; - - /** - * The column for the user readable name of the key bound - * (escaped version, with '<' and '>'). - */ - Gtk::TreeModelColumn keyDisplayColumn; - - /** - * The column for the gdkkeytypes.h code of the modifiers. - */ - Gtk::TreeModelColumn modifiersColumn; - - /** - * The column for the gdkkeysyms.h code of the key. - */ - Gtk::TreeModelColumn keyValueColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(actionColumn); - add(keyNameColumn); - add(keyDisplayColumn); - add(modifiersColumn); - add(keyValueColumn); - } - }; - - - /** - * The column model for the key bindings. - */ - ModelColumns keyBindingsColumns; - - /** - * The tree model, as a GTK reference, for the key bindings. - */ - Glib::RefPtr keyBindingsModel; - - /** - * The tree view for the key bindings. - */ - ZebraTreeView * keyBindingsTreeView; - - /** - * The backup view shown in the backup section. - */ - Ptr::Ref backupView; - - /** - * The RdsView shown in the RDS section. - */ - Ptr::Ref rdsView; - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - OptionsWindow(Gtk::ToggleButton * windowOpenerButton) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~OptionsWindow(void) throw () - { - } - - /** - * Return the BackupList object shown by the widget. - */ - Ptr::Ref - getBackupList(void) throw () - { - return backupView ? backupView->getBackupList() - : Ptr::Ref(); - } - - /** - * Show the window and return when the user hides it. - * This is used by GLiveSupport when the authentication server - * address is wrong. It opens the window to the "Servers" tab. - */ - void - run(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // OptionsWindow_h - diff --git a/src/products/gLiveSupport/src/PlaylistWindow.cxx b/src/products/gLiveSupport/src/PlaylistWindow.cxx deleted file mode 100644 index 30944563d..000000000 --- a/src/products/gLiveSupport/src/PlaylistWindow.cxx +++ /dev/null @@ -1,806 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" - -#include "PlaylistWindow.h" - - -using namespace Glib; - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "playlistWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "PlaylistWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -PlaylistWindow :: PlaylistWindow(Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton), - isPlaylistModified(false) -{ - // set up the file name entry - Gtk::Label * nameLabel; - glade->get_widget("nameLabel1", nameLabel); - nameLabel->set_label(*getResourceUstring("nameLabel")); - glade->get_widget("nameEntry1", nameEntry); - nameEntry->signal_changed().connect(sigc::mem_fun(*this, - &PlaylistWindow::onTitleEdited)); - - // set up the entries tree view - entriesModel = Gtk::ListStore::create(modelColumns); - glade->get_widget_derived("entriesView1", entriesView); - entriesView->set_model(entriesModel); - entriesView->connectModelSignals(entriesModel); - - entriesView->appendColumn(*getResourceUstring("startColumnLabel"), - modelColumns.startColumn, - 60); - entriesView->appendColumn(*getResourceUstring("titleColumnLabel"), - modelColumns.titleColumn, - 200); - entriesView->appendEditableColumn( - *getResourceUstring("fadeInColumnLabel"), - modelColumns.fadeInColumn, - fadeInColumnId, - 60); - entriesView->appendColumn(*getResourceUstring("lengthColumnLabel"), - modelColumns.lengthColumn, - 60); - entriesView->appendEditableColumn( - *getResourceUstring("fadeOutColumnLabel"), - modelColumns.fadeOutColumn, - fadeOutColumnId, - 60); - - entriesView->signal_button_press_event().connect_notify(sigc::mem_fun(*this, - &PlaylistWindow::onEntryClicked)); - entriesView->signalCellEdited().connect(sigc::mem_fun(*this, - &PlaylistWindow::onFadeInfoEdited )); - entriesView->signal_key_press_event().connect(sigc::mem_fun(*this, - &PlaylistWindow::onKeyPressed)); - - // set up the status bar - glade->get_widget("statusBar1", statusBar); - statusBar->set_label(""); - - // create the right-click entry context menu - rightClickMenu.reset(new Gtk::Menu()); - Gtk::Menu::MenuList & rightClickMenuList = rightClickMenu->items(); - - rightClickMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("upMenuItem"), - sigc::mem_fun(*this, - &PlaylistWindow::onUpItem))); - rightClickMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("downMenuItem"), - sigc::mem_fun(*this, - &PlaylistWindow::onDownItem))); - rightClickMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("removeMenuItem"), - sigc::mem_fun(*this, - &PlaylistWindow::onRemoveItem))); - - // set up the "lock fades" check button - Gtk::CheckButton * lockFadesCheckButton; - glade->get_widget("lockFadesCheckButton1", lockFadesCheckButton); - lockFadesCheckButton->set_label(*getResourceUstring( - "lockFadesCheckButtonLabel")); - lockFadesCheckButton->set_active(true); - areFadesLocked = true; - lockFadesCheckButton->signal_toggled().connect(sigc::mem_fun(*this, - &PlaylistWindow::onLockFadesCheckButtonClicked)); - - // set up the "total time" display - Gtk::Label * lengthTextLabel; - glade->get_widget("lengthTextLabel1", lengthTextLabel); - lengthTextLabel->set_label(*getResourceUstring("lengthLabel")); - - glade->get_widget("lengthValueLabel1", lengthValueLabel); - lengthValueLabel->set_label("00:00:00"); - - // register the signal handlers for the buttons - Gtk::Button * closeButton; - glade->get_widget("saveButton1", saveButton); - glade->get_widget("closeButton1", closeButton); - saveButton->signal_clicked().connect(sigc::mem_fun(*this, - &PlaylistWindow::onSaveButtonClicked)); - closeButton->signal_clicked().connect(sigc::mem_fun(*this, - &PlaylistWindow::onBottomCloseButtonClicked)); - - // get notified when the playlist is modified outside of the window - gLiveSupport->signalEditedPlaylistModified().connect(sigc::mem_fun(*this, - &PlaylistWindow::onPlaylistModified )); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -PlaylistWindow :: ~PlaylistWindow (void) - throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Save the edited playlist. - *----------------------------------------------------------------------------*/ -bool -PlaylistWindow :: savePlaylist(bool reopen) throw () -{ - try { - Ptr::Ref playlist - = gLiveSupport->getEditedPlaylist(); - if (!playlist) { - return false; - } - - Ptr::Ref title(new Glib::ustring( - nameEntry->get_text())); - if (*title == "") { - statusBar->set_text(*getResourceUstring("emptyTitleErrorMsg")); - return false; - } - - playlist->setTitle(title); - gLiveSupport->savePlaylist(); - if (reopen) { - gLiveSupport->openPlaylistForEditing(playlist->getId()); - } - setPlaylistModified(false); - - Ptr::Ref statusText = formatMessage( - "playlistSavedMsg", - *playlist->getTitle()); - statusBar->set_text(*statusText); - return true; - - } catch (XmlRpcException &e) { - statusBar->set_text(e.what()); - return false; - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the save button getting clicked. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onSaveButtonClicked(void) throw () -{ - savePlaylist(true); -} - - -/*------------------------------------------------------------------------------ - * Cancel the edited playlist, after asking for confirmation. - *----------------------------------------------------------------------------*/ -bool -PlaylistWindow :: cancelPlaylist(void) throw () -{ - if (gLiveSupport->getEditedPlaylist()) { - if (!isPlaylistModified) { - gLiveSupport->cancelEditedPlaylist(); - } else { - Gtk::ResponseType result = runConfirmationDialog(); - switch (result) { - case Gtk::RESPONSE_NO: - try { - gLiveSupport->cancelEditedPlaylist(); - } catch (XmlRpcException &e) { - std::cerr << e.what() << std::endl; - return false; - } - setPlaylistModified(false); - break; - - case Gtk::RESPONSE_YES: - if (!savePlaylist(false)) { - return false; - } - break; - - case Gtk::RESPONSE_CANCEL: - return false; - - default : // can happen if the window - return false; // is closed with Alt-F4 - } // -- treated as cancel - } - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * Run the confirmation window. - *----------------------------------------------------------------------------*/ -Gtk::ResponseType -PlaylistWindow :: runConfirmationDialog(void) throw () -{ - Gtk::Dialog * confirmationDialog; - Gtk::Label * confirmationDialogLabel; - Gtk::Button * noButton; - glade->get_widget("confirmationDialog1", confirmationDialog); - glade->get_widget("confirmationDialogLabel1", confirmationDialogLabel); - glade->get_widget("noButton1", noButton); - - Glib::ustring message = ""; - message += *getResourceUstring("savePlaylistDialogMsg"); - message += ""; - confirmationDialogLabel->set_label(message); - noButton->set_label(*getResourceUstring("closeWithoutSavingButtonLabel")); - - Gtk::ResponseType response = Gtk::ResponseType( - confirmationDialog->run()); - confirmationDialog->hide(); - return response; -} - - -/*------------------------------------------------------------------------------ - * Clean and close the window. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: closeWindow(void) throw () -{ - statusBar->set_text(""); - nameEntry->set_text(""); - entriesModel->clear(); - setPlaylistModified(false); - hide(); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the save button getting clicked. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onBottomCloseButtonClicked(void) throw () -{ - if (cancelPlaylist()) { - closeWindow(); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the "lock fades" check button toggled. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onLockFadesCheckButtonClicked(void) - throw () -{ - areFadesLocked = !areFadesLocked; -} - - -/*------------------------------------------------------------------------------ - * Show the contents of the currently edited playlist. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: showContents(void) throw () -{ - Ptr::Ref playlist; - Playlist::const_iterator it; - Playlist::const_iterator end; - - playlist = gLiveSupport->getEditedPlaylist(); - - if (playlist) { - nameEntry->set_text(*playlist->getTitle()); - - Ptr::Ref - lengthStr = TimeConversion::timeDurationToHhMmSsString( - playlist->getPlaylength()); - lengthValueLabel->set_text(*lengthStr); - - entriesModel->clear(); - for (it = playlist->begin(); it != playlist->end(); ++it) { - Ptr::Ref playlistElement - = it->second; - Ptr::Ref playable = playlistElement->getPlayable(); - Gtk::TreeModel::Row row = *(entriesModel->append()); - - row[modelColumns.playlistElementColumn] - = playlistElement; - row[modelColumns.startColumn] - = *TimeConversion::timeDurationToHhMmSsString( - playlistElement->getRelativeOffset()); - row[modelColumns.titleColumn] - = Glib::Markup::escape_text(*playable->getTitle()); - row[modelColumns.lengthColumn] - = *TimeConversion::timeDurationToHhMmSsString( - playable->getPlaylength()); - - Ptr::Ref fadeInfo = playlistElement->getFadeInfo(); - Ptr::Ref fadeIn, fadeOut; - if (fadeInfo) { - fadeIn = fadeInfo->getFadeIn(); - fadeOut = fadeInfo->getFadeOut(); - } - row[modelColumns.fadeInColumn] - = (fadeIn && fadeIn->total_microseconds() != 0) - ? *TimeConversion::timeDurationToShortString(fadeIn) - : "- "; - row[modelColumns.fadeOutColumn] - = (fadeOut && fadeOut->total_microseconds() != 0) - ? *TimeConversion::timeDurationToShortString(fadeOut) - : "- "; - } - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the fade info being edited. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onTitleEdited(void) throw() -{ - Ptr::Ref playlist = gLiveSupport->getEditedPlaylist(); - if (!playlist) { - try { - gLiveSupport->openPlaylistForEditing(); - playlist = gLiveSupport->getEditedPlaylist(); - - } catch (XmlRpcException &e) { - std::cerr << "error in PlaylistWindow::" - "onTitleEdited(): " - << e.what() << std::endl; - return; - } - } - Ptr::Ref title(new Glib::ustring( - nameEntry->get_text())); - if (*title != *playlist->getTitle()) { - playlist->setTitle(title); - setPlaylistModified(true); - } - - showContents(); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the fade info being edited. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onFadeInfoEdited( - const Glib::ustring & pathString, - int columnId, - const Glib::ustring & newText) - throw() -{ - Gtk::TreeModel::Path path(pathString); - std::vector rowNumberVector = path.get_indices(); - int rowNumber = rowNumberVector.at(0); - - Ptr::Ref newTime; - try { - Ptr::Ref newTextPtr(new std::string(newText)); - newTime = TimeConversion::parseTimeDuration(newTextPtr); - } catch (boost::bad_lexical_cast &e) { - showContents(); // bad time format; restore previous state - return; - } - - if (newTime->is_negative()) { - showContents(); - return; - } - - Ptr::Ref playlist = gLiveSupport->getEditedPlaylist(); - Playlist::const_iterator iter = playlist->begin(); - for (int i=0; i::Ref playlistElement = iter->second; - - switch (columnId) { - case fadeInColumnId : - setFadeIn(playlistElement, newTime); - if (areFadesLocked && iter-- != playlist->begin()) { - Ptr::Ref prevPlaylistElement = iter->second; - setFadeOut(prevPlaylistElement, newTime); - } - break; - case fadeOutColumnId : - setFadeOut(playlistElement, newTime); - if (areFadesLocked && ++iter != playlist->end()) { - Ptr::Ref nextPlaylistElement = iter->second; - setFadeIn(nextPlaylistElement, newTime); - } - break; - default : - return; // should never happen - } - - showContents(); -} - - -/*------------------------------------------------------------------------------ - * Auxilliary function: set the fade in of a playlist element. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: setFadeIn( - Ptr::Ref playlistElement, - Ptr::Ref newFadeIn) - throw() -{ - Ptr::Ref oldFadeInfo = playlistElement->getFadeInfo(); - Ptr::Ref oldFadeOut; - if (oldFadeInfo) { - if (*oldFadeInfo->getFadeIn() == *newFadeIn) { - return; - } - oldFadeOut = oldFadeInfo->getFadeOut(); - } else { - oldFadeOut.reset(new time_duration(0,0,0,0)); - } - Ptr::Ref newFadeInfo(new FadeInfo( - newFadeIn, oldFadeOut )); - if (isLengthOkay(playlistElement, newFadeInfo)) { - playlistElement->setFadeInfo(newFadeInfo); - setPlaylistModified(true); - } -} - - -/*------------------------------------------------------------------------------ - * Auxilliary function: set the fade out of a playlist element. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: setFadeOut( - Ptr::Ref playlistElement, - Ptr::Ref newFadeOut) - throw() -{ - Ptr::Ref oldFadeInfo = playlistElement->getFadeInfo(); - Ptr::Ref oldFadeIn; - if (oldFadeInfo) { - if (*oldFadeInfo->getFadeOut() == *newFadeOut) { - return; - } - oldFadeIn = oldFadeInfo->getFadeIn(); - } else { - oldFadeIn.reset(new time_duration(0,0,0,0)); - } - Ptr::Ref newFadeInfo(new FadeInfo( - oldFadeIn, newFadeOut )); - if (isLengthOkay(playlistElement, newFadeInfo)) { - playlistElement->setFadeInfo(newFadeInfo); - setPlaylistModified(true); - } -} - - -/*------------------------------------------------------------------------------ - * Auxilliary function: check that fades are not longer than the whole clip. - *----------------------------------------------------------------------------*/ -inline bool -PlaylistWindow :: isLengthOkay( - Ptr::Ref playlistElement, - Ptr::Ref newFadeInfo) - throw() -{ - time_duration totalFades = *newFadeInfo->getFadeIn() - + *newFadeInfo->getFadeOut(); - return (totalFades <= *playlistElement->getPlayable()->getPlaylength()); -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the playlist being modified outside the window. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onPlaylistModified(void) throw() -{ - setPlaylistModified(true); -} - - -/*------------------------------------------------------------------------------ - * Event handler for an entry being clicked in the list - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onEntryClicked(GdkEventButton * event) - throw() -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - Gtk::TreePath currentPath; - Gtk::TreeViewColumn * column; - int cell_x, - cell_y; - bool foundValidRow = entriesView->get_path_at_pos( - int(event->x), int(event->y), - currentPath, column, - cell_x, cell_y); - - if (foundValidRow) { - currentItem = entriesModel->get_iter(currentPath); - if (currentItem) { - rightClickMenu->popup(event->button, event->time); - } - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Up menu item selected from the context menu. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onUpItem(void) throw() -{ - if (currentItem && currentItem != entriesModel->children().begin()) { - int rowNumber = (*currentItem) - [modelColumns.rowNumberColumn]; - Gtk::TreeIter previousItem = currentItem; - --previousItem; - swapPlaylistElements(previousItem, currentItem); - setPlaylistModified(true); - showContents(); - selectRow(--rowNumber); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Down menu item selected from the context menu. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onDownItem(void) throw() -{ - if (currentItem) { - Gtk::TreeIter nextItem = currentItem; - ++nextItem; - if (nextItem) { - int rowNumber = (*currentItem) - [modelColumns.rowNumberColumn]; - swapPlaylistElements(currentItem, nextItem); - setPlaylistModified(true); - showContents(); - selectRow(++rowNumber); - } - } -} - - -/*------------------------------------------------------------------------------ - * Swap two playlist elements in the edited playlist. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: swapPlaylistElements( - Gtk::TreeIter firstIter, - Gtk::TreeIter secondIter) - throw() -{ - Ptr::Ref - firstElement = (*firstIter) [modelColumns.playlistElementColumn]; - Ptr::Ref - secondElement = (*secondIter)[modelColumns.playlistElementColumn]; - - // remove the two playlist elements - Ptr::Ref playlist = gLiveSupport->getEditedPlaylist(); - playlist->removePlaylistElement(firstElement->getId()); - playlist->removePlaylistElement(secondElement->getId()); - - // swap the relative offsets so that elt2.begin <-- elt1.begin - // and elt1.end <-- elt2.end - Ptr::Ref firstStart = firstElement->getRelativeOffset(); - Ptr::Ref secondStart(new time_duration( - *secondElement->getRelativeOffset() - + *secondElement->getPlayable() - ->getPlaylength() - - *firstElement->getPlayable() - ->getPlaylength() )); - firstElement->setRelativeOffset(secondStart); - secondElement->setRelativeOffset(firstStart); - - // read the fade infos - bool hasFadeInfo = false; - Ptr::Ref firstFadeInfo = firstElement->getFadeInfo(); - Ptr::Ref secondFadeInfo = secondElement->getFadeInfo(); - Ptr::Ref beginFade, - midFade1, - midFade2, - endFade; - - if (firstFadeInfo) { - hasFadeInfo = true; - beginFade = firstFadeInfo->getFadeIn(); - midFade1 = firstFadeInfo->getFadeOut(); - } else { - beginFade.reset(new time_duration(0,0,0,0)); - midFade1 .reset(new time_duration(0,0,0,0)); - } - - if (secondFadeInfo) { - hasFadeInfo = true; - midFade2 = secondFadeInfo->getFadeIn(); - endFade = secondFadeInfo->getFadeOut(); - } else if (hasFadeInfo) { - midFade2.reset(new time_duration(0,0,0,0)); - endFade .reset(new time_duration(0,0,0,0)); - } - - // move fades around if they seem to be simple crossfades - // otherwise, just leave them as they are - if (hasFadeInfo && *midFade1 == *midFade2) { - Ptr::Ref firstFadeInfo (new FadeInfo(beginFade, midFade1)); - Ptr::Ref secondFadeInfo(new FadeInfo(midFade1, endFade )); - - firstElement->setFadeInfo(secondFadeInfo); - secondElement->setFadeInfo(firstFadeInfo); - } - - // add the playlist elements back in - playlist->addPlaylistElement(firstElement); - playlist->addPlaylistElement(secondElement); - - // Note: - // removing and then adding is necessary to make sure that the playlist - // elements are correctly indexed by their relative offset in the playlist. -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Remove menu item selected from the context menu. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: onRemoveItem(void) throw() -{ - if (currentItem) { - Ptr::Ref - playlist = gLiveSupport->getEditedPlaylist(); - Ptr::Ref - playlistElement = (*currentItem) - [modelColumns.playlistElementColumn]; - - playlist->removePlaylistElement(playlistElement->getId()); - playlist->eliminateGaps(); - - setPlaylistModified(true); - showContents(); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for a key pressed. - *----------------------------------------------------------------------------*/ -bool -PlaylistWindow :: onKeyPressed(GdkEventKey * event) - throw () -{ - if (event->type == GDK_KEY_PRESS) { - KeyboardShortcut::Action action = gLiveSupport->findAction( - "playlistWindow", - Gdk::ModifierType(event->state), - event->keyval); - switch (action) { - case KeyboardShortcut::moveItemUp : - findCurrentItem(); - onUpItem(); - return true; - - case KeyboardShortcut::moveItemDown : - findCurrentItem(); - onDownItem(); - return true; - - case KeyboardShortcut::removeItem : - findCurrentItem(); - onRemoveItem(); - return true; - - default : break; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Find (an iterator pointing to) the currently selected row. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: findCurrentItem(void) throw () -{ - Glib::RefPtr selection - = entriesView->get_selection(); - currentItem = selection->get_selected(); -} - - -/*------------------------------------------------------------------------------ - * Select (highlight) the nth row. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: selectRow(int rowNumber) throw () -{ - Gtk::TreeModel::iterator iter = entriesModel->children().begin(); - for (; rowNumber > 0; --rowNumber) { - ++iter; - } - if (iter) { - Glib::RefPtr selection - = entriesView->get_selection(); - selection->select(iter); - } -} - - -/*------------------------------------------------------------------------------ - * Set the value of the isPlaylistModified variable. - *----------------------------------------------------------------------------*/ -void -PlaylistWindow :: setPlaylistModified(bool newValue) - throw () -{ - isPlaylistModified = newValue; - saveButton->set_sensitive(newValue); -} - diff --git a/src/products/gLiveSupport/src/PlaylistWindow.h b/src/products/gLiveSupport/src/PlaylistWindow.h deleted file mode 100644 index 8019b2174..000000000 --- a/src/products/gLiveSupport/src/PlaylistWindow.h +++ /dev/null @@ -1,425 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlaylistWindow_h -#define PlaylistWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "GuiWindow.h" -#include "GLiveSupport.h" - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The Simple Playlist Management Window. Allow to edit playlists in - * a top-down view fashion. - * - * The layout of this window is roughly the following: - *

- *  +--- simple playlist management window --------+
- *  | name:    +-- name input -------------+       |
- *  | +-- playlist entries ----------------------+ |
- *  | | +-- entry1 ----------------------------+ | |
- *  | | +-- entry2 ----------------------------+ | |
- *  | |  ...                                     | |
- *  | +------------------------------------------+ |
- *  | +- lock fades checkbox -+ |
- *  |        +- save button -+  +- close button -+ |
- *  | +-- status bar ----------------------------+ |
- *  +----------------------------------------------+
- *  
- * - */ -class PlaylistWindow : public GuiWindow -{ - private: - - /** - * Constants for identifying the two fade info columns. - */ - enum { fadeInColumnId, - fadeOutColumnId }; - - /** - * A flag set to true when the edited playlist is modified. - */ - bool isPlaylistModified; - - /** - * A flag controlled by the "lock fades" check button. - * This determines whether the fade-out of a clip is assumed to - * be equal to the fade-in of the next clip. - */ - bool areFadesLocked; - - /** - * An iterator pointing to the current row, for popup functions. - * It is set by onEntryClicked(), before popping up the menu. - */ - Gtk::TreeIter currentItem; - - /** - * The input text field for the name of the playlist. - */ - Gtk::Entry * nameEntry; - - /** - * The entry tree view, now only showing rows. - */ - ZebraTreeView * entriesView; - - /** - * The entry tree model, as a GTK reference. - */ - Glib::RefPtr entriesModel; - - /** - * The label containing the length of the playlist. - */ - Gtk::Label * lengthValueLabel; - - /** - * The status bar. - */ - Gtk::Label * statusBar; - - /** - * The Save Button. - */ - Gtk::Button * saveButton; - - /** - * The right-click context menu that comes up when right-clicking - * a playlist element. - */ - Ptr::Ref rightClickMenu; - - /** - * Find (an iterator pointing to) the currently selected row. - * - * This is an auxilliary function used by onKeyPressed(). - */ - void - findCurrentItem(void) throw (); - - /** - * Select (highlight) the nth row. - * - * This is an auxilliary function used by onUpItem() and onDownItem(). - * - * @param rowNumber the number of the row to be selected. - */ - void - selectRow(int rowNumber) throw (); - - /** - * Swap two playlist elements in the edited playlist. - * This is used by onUpItem() and onDownItem(). - * - * @param firstIter the first item, to be swapped... - * @param secondIter ... with this second item - */ - void - swapPlaylistElements(Gtk::TreeIter firstIter, - Gtk::TreeIter secondIter) throw (); - - /** - * Signal handler for the "remove" menu item selected from - * the right-click context menu. - */ - void - onRemoveItem(void) throw (); - - /** - * Set the fade in of a playlist element. - */ - void - setFadeIn(Ptr::Ref playlistElement, - Ptr::Ref newFadeIn) throw(); - - /** - * Set the fade out of a playlist element. - */ - void - setFadeOut(Ptr::Ref playlistElement, - Ptr::Ref newFadeOut) throw(); - - /** - * Check that fades are not longer than the whole clip. - * - * @return true if (fadeIn + fadeOut <= playlength). - */ - bool - isLengthOkay(Ptr::Ref playlistElement, - Ptr::Ref newFadeInfo) throw(); - - /** - * Clean and close the window. - * Set all widgets to empty and close the window. - */ - void - closeWindow(void) throw(); - - /** - * Save the edited playlist. - * - * @param reopen true if the playlist needs to be opened for - * editing again after saving it. - * @return true if the playlist was saved successully. - */ - bool - savePlaylist(bool reopen) throw (); - - /** - * Set the value of the isPlaylistModified variable. - */ - void - setPlaylistModified(bool newValue) throw (); - - /** - * Run the confirmation dialog. - * - * @return the response ID returned by the dialog. - */ - Gtk::ResponseType - runConfirmationDialog(void) throw (); - - - protected: - - /** - * The columns model needed by Gtk::TreeView. - * Lists one playlist entry per row. - * - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - /** - * The column for the start of the playlist entry. - */ - Gtk::TreeModelColumn startColumn; - - /** - * The column for the title of the audio clip or playlist. - */ - Gtk::TreeModelColumn titleColumn; - - /** - * The column for the fade in of the playlist entry. - */ - Gtk::TreeModelColumn fadeInColumn; - - /** - * The column for the length of the playlist entry. - */ - Gtk::TreeModelColumn lengthColumn; - - /** - * The column for the fade out of the playlist entry. - */ - Gtk::TreeModelColumn fadeOutColumn; - - /** - * The column for the pointer to the playlist element. - */ - Gtk::TreeModelColumn::Ref> - playlistElementColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(startColumn); - add(titleColumn); - add(fadeInColumn); - add(lengthColumn); - add(fadeOutColumn); - add(playlistElementColumn); - } - }; - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * Signal handler for the title being edited. - */ - void - onTitleEdited(void) throw(); - - /** - * Signal handler for the fade info being edited. - * - * @path the path representing the row in the tree model - * @columnId the ID of the row which was passed to appendColumn() - * @newText the new fade value - */ - void - onFadeInfoEdited(const Glib::ustring & path, - int columnId, - const Glib::ustring & newText) throw(); - - /** - * Signal handler for the playlist being modified outside the window. - */ - void - onPlaylistModified(void) throw(); - - /** - * Signal handler for the mouse clicked on one of the entries. - * This is used to pop up the right-click context menu. - * - * @param event the button event recieved - */ - void - onEntryClicked(GdkEventButton * event) throw (); - - /** - * Signal handler for a key pressed at one of the entries. - * The keys can be customized by the keyboardShortcutContainer - * element in the gLiveSupport configuration file. - * - * The actions handled are: moveItemUp, moveItemDown and removeItem. - * - * @param event the button event received - * @return true if the key press was fully handled, false if not - */ - bool - onKeyPressed(GdkEventKey * event) throw (); - - /** - * Signal handler for a click on the save button. - */ - void - onSaveButtonClicked(void) throw (); - - /** - * Signal handler for a click on the close button at the bottom - * right corner. - * This cancels the edited playlist; the normal close button (X) - * at the upper right corner hides the window only. - * If the playlist has been modified, a confirmation message will - * be displayed. - */ - void - onBottomCloseButtonClicked(void) throw (); - - /** - * Signal handler for the "lock fades" check button toggled. - */ - void - onLockFadesCheckButtonClicked(void) throw (); - - /** - * Signal handler for the "up" menu item selected from - * the right-click context menu. - */ - void - onUpItem(void) throw (); - - /** - * Signal handler for the "down" menu item selected from - * the right-click context menu. - */ - void - onDownItem(void) throw (); - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - PlaylistWindow(Gtk::ToggleButton * windowOpenerButton) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~PlaylistWindow(void) throw (); - - /** - * Show / update the contents of the playlist management window. - */ - virtual void - showContents(void) throw (); - - /** - * Cancel the edited playlist, after asking for confirmation. - * - * Displays a "Save playlist?" dialog, with "yes", "no" and - * "cancel" buttons. - * - * @return true if the window was closed (the user selected "yes" - * or "no"); false if not (the user selected "cancel"). - * @see GLiveSupport::cancelEditedPlaylist() - * @see closeWindow() - */ - virtual bool - cancelPlaylist(void) throw(); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // PlaylistWindow_h - diff --git a/src/products/gLiveSupport/src/RdsEntry.cxx b/src/products/gLiveSupport/src/RdsEntry.cxx deleted file mode 100644 index f17995b0c..000000000 --- a/src/products/gLiveSupport/src/RdsEntry.cxx +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - - -#include "RdsEntry.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -RdsEntry :: RdsEntry(GuiObject * parent, - int index, - const Glib::ustring & type, - int width) - throw () - : GuiComponent(parent) -{ - this->type.reset(new const Glib::ustring(type)); - - glade->get_widget(addIndex("rdsCheckButton", index), checkButton); - checkButton->set_label(*getResourceUstring(type + "rdsLabel")); - - glade->get_widget(addIndex("rdsEntry", index), entry); - entry->set_width_chars(width); -} - - -/*------------------------------------------------------------------------------ - * Set the state of the widget. - *----------------------------------------------------------------------------*/ -void -RdsEntry :: setOptions(bool enabled, - Ptr::Ref value) throw () -{ - checkButton->set_active(enabled); - entry->set_text(*value); - - checkButtonSaved = enabled; - entrySaved = value; -} - - -/*------------------------------------------------------------------------------ - * Save the changes made by the user. - *----------------------------------------------------------------------------*/ -bool -RdsEntry :: saveChanges(void) throw () -{ - bool checkButtonNow = checkButton->get_active(); - Ptr::Ref - entryNow(new const Glib::ustring(entry->get_text())); - - if (!entrySaved || checkButtonNow != checkButtonSaved - || *entryNow != *entrySaved) { - Ptr::Ref optionsContainer = - gLiveSupport->getOptionsContainer(); - optionsContainer->setRdsOptions(type, entryNow, checkButtonNow); - checkButtonSaved = checkButtonNow; - entrySaved = entryNow; - return true; - } else { - return false; - } -} - - -/*------------------------------------------------------------------------------ - * Clear the entries of the widget. - *----------------------------------------------------------------------------*/ -void -RdsEntry :: reset(void) throw () -{ - Ptr::Ref empty(new const Glib::ustring("")); - setOptions(false, empty); -} - diff --git a/src/products/gLiveSupport/src/RdsEntry.h b/src/products/gLiveSupport/src/RdsEntry.h deleted file mode 100644 index ff71e951b..000000000 --- a/src/products/gLiveSupport/src/RdsEntry.h +++ /dev/null @@ -1,170 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RdsEntry_h -#define RdsEntry_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/NumericTools.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A single RDS input field. - * - */ -class RdsEntry : public GuiComponent, - private NumericTools -{ - private: - - /** - * The RDS type of the object (PS, PI, RT, etc). - */ - Ptr::Ref type; - - /** - * The saved state of the check button. - */ - bool checkButtonSaved; - - /** - * The saved contents of the entry. - */ - Ptr::Ref entrySaved; - - - protected: - - /** - * The enable/disable checkbox. - */ - Gtk::CheckButton * checkButton; - - /** - * The entry field. - */ - Gtk::Entry * entry; - - - public: - - /** - * Constructor. - * The type parameter is a string of 2 or 3 upper-case characters, - * see http://en.wikipedia.org/wiki/Radio_Data_System. - * - * @param parent the GuiObject which contains this one. - * @param index the position of this item in the list of - * RDS entries. - * @param type the type of RDS data (PS, PI, RT, etc). - * @param width the width of the entry, in characters. - */ - RdsEntry(GuiObject * parent, - int index, - const Glib::ustring & type, - int width) throw (); - - /** - * A virtual destructor. - */ - virtual - ~RdsEntry(void) throw () - { - } - - /** - * Get the type of the widget. - * Returns the RDS option type (PS, PI, RT, ...). - * - * @return the "type" parameter passed to the constructor. - */ - Ptr::Ref - getType(void) throw () - { - return type; - } - - /** - * Set the state of the widget. - * - * @param enabled the new state of the checkBox. - * @param value the new contents of the entryBin. - */ - void - setOptions(bool enabled, - Ptr::Ref value) throw (); - - /** - * Save the changes made by the user. - * - * @return true if any changes were saved; false otherwise. - */ - bool - saveChanges(void) throw (); - - /** - * Clear the entries of the widget. - */ - void - reset(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // RdsEntry_h - diff --git a/src/products/gLiveSupport/src/RdsView.cxx b/src/products/gLiveSupport/src/RdsView.cxx deleted file mode 100644 index 98a7a5cc9..000000000 --- a/src/products/gLiveSupport/src/RdsView.cxx +++ /dev/null @@ -1,147 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "RdsView.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "rdsView"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -RdsView :: RdsView (GuiObject * parent) - throw () - : GuiComponent(parent, - bundleName) -{ - Gtk::Label * deviceLabel; - glade->get_widget("rdsDeviceLabel1", deviceLabel); - deviceLabel->set_label(*getResourceUstring("deviceLabel")); - - glade->get_widget("rdsDeviceEntry1", deviceEntry); - - Ptr::Ref psEntry(new RdsEntry(this, 0, "PS", 8)); - Ptr::Ref piEntry(new RdsEntry(this, 1, "PI", 4)); - Ptr::Ref rtEntry(new RdsEntry(this, 2, "RT", 32)); - - rdsEntryList.push_back(psEntry); - rdsEntryList.push_back(piEntry); - rdsEntryList.push_back(rtEntry); - - reset(); -} - - -/*------------------------------------------------------------------------------ - * Save the changes made by the user. - *----------------------------------------------------------------------------*/ -bool -RdsView :: saveChanges(void) throw () -{ - bool touched = false; - - Ptr::Ref options = gLiveSupport->getOptionsContainer(); - Ptr::Ref oldDevice = options->getOptionItem( - OptionsContainer::serialDeviceName); - Ptr::Ref newDevice(new const Glib::ustring( - deviceEntry->get_text() )); - if (*oldDevice != *newDevice) { - options->setOptionItem(OptionsContainer::serialDeviceName, newDevice); - touched = true; - } - - RdsEntryListType::const_iterator it; - for (it = rdsEntryList.begin(); it != rdsEntryList.end(); ++it) { - Ptr::Ref rdsEntry = *it; - touched |= rdsEntry->saveChanges(); - } - - return touched; -} - - -/*------------------------------------------------------------------------------ - * Reset the widget to its saved state. - *----------------------------------------------------------------------------*/ -void -RdsView :: reset(void) throw () -{ - Ptr::Ref options = gLiveSupport->getOptionsContainer(); - deviceEntry->set_text(*options->getOptionItem( - OptionsContainer::serialDeviceName)); - - RdsEntryListType::const_iterator it; - for (it = rdsEntryList.begin(); it != rdsEntryList.end(); ++it) { - fillEntry(*it); - } -} - - -/*------------------------------------------------------------------------------ - * Fill in the entry from the OptionsContainer. - *----------------------------------------------------------------------------*/ -void -RdsView :: fillEntry(Ptr::Ref entry) throw () -{ - Ptr::Ref options = gLiveSupport->getOptionsContainer(); - - if (options) { - Ptr::Ref type = entry->getType(); - try { - bool enabled = options->getRdsEnabled(type); - Ptr::Ref - value = options->getRdsValue(type); - entry->setOptions(enabled, value); - } catch (std::invalid_argument &e) { - entry->reset(); - } - } -} - diff --git a/src/products/gLiveSupport/src/RdsView.h b/src/products/gLiveSupport/src/RdsView.h deleted file mode 100644 index ada97ba90..000000000 --- a/src/products/gLiveSupport/src/RdsView.h +++ /dev/null @@ -1,157 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RdsView_h -#define RdsView_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "RdsEntry.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The RDS view, a subclass of Gtk::VBox. - * This will be contained in another window, currently in the OptionsWindow. - * - * The layout of the view is roughly the following: - *

- *  +--- RDS view -----------------------------------+
- *  |                    ___________                 |
- *  | [x] Station name: |___________|                |
- *  |                  ________                      |
- *  | [x] Station ID: |________|                     |
- *  |                  ___________________________   |
- *  | [ ] Clip info:  |___________________________|  |
- *  |                                                |
- *  +------------------------------------------------+
- *  
- * where each item has a checkbox [x] with which one can enable or disable it. - * - * On construction, the entries are filled in using the OptionsContainer - * object found in the GLiveSupport object. The OptionsContainer can be - * updated to the new contents of the entries using saveChanges(), and the - * entries can be re-initialized from the OptionsContainer using reset(). - * - */ -class RdsView : public GuiComponent -{ - private: - - /** - * The type for the list of entry widgets. - */ - typedef std::vector::Ref> RdsEntryListType; - - /** - * The list of the entry widgets. - */ - RdsEntryListType rdsEntryList; - - /** - * Fill in the entry from the OptionsContainer. - * - * @param entry the RdsEntry to be filled in. - */ - void - fillEntry(Ptr::Ref entry) throw (); - - - protected: - - /** - * The entry field for the serial device. - */ - Gtk::Entry * deviceEntry; - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - */ - RdsView(GuiObject * parent) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~RdsView(void) throw () - { - } - - /** - * Save the changes made by the user. - * - * @return true if any changes were saved; false otherwise. - */ - bool - saveChanges(void) throw (); - - /** - * Reset the widget to its saved state. - */ - void - reset(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // RdsView_h - diff --git a/src/products/gLiveSupport/src/RestoreBackupWindow.cxx b/src/products/gLiveSupport/src/RestoreBackupWindow.cxx deleted file mode 100644 index b7c043d9a..000000000 --- a/src/products/gLiveSupport/src/RestoreBackupWindow.cxx +++ /dev/null @@ -1,281 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "RestoreBackupWindow.h" - - -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "restoreBackupWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "RestoreBackupWindow.glade"; - -/*------------------------------------------------------------------------------ - * The interval between two calls to restoreBackupCheck(), in milliseconds. - *----------------------------------------------------------------------------*/ -const unsigned int timerInterval = 10000; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -RestoreBackupWindow :: RestoreBackupWindow ( - Ptr::Ref fileName) - throw () - : GuiWindow(bundleName, - gladeFileName), - fileName(fileName), - currentState(AsyncState::pendingState) -{ - Gtk::Button * cancelButton; - glade->get_widget("restoreBackupMessageLabel1", messageLabel); - glade->get_widget("restoreBackupCancelButton1", cancelButton); - glade->get_widget("restoreBackupOkButton1", okButton); - - cancelButton->signal_clicked().connect(sigc::mem_fun(*this, - &RestoreBackupWindow::onCancelButtonClicked)); - okButton->signal_clicked().connect(sigc::mem_fun(*this, - &RestoreBackupWindow::onOkButtonClicked)); - - restoreBackupOpen(); -} - - -/*------------------------------------------------------------------------------ - * The event when the cancel button has been clicked. - *----------------------------------------------------------------------------*/ -void -RestoreBackupWindow :: onCancelButtonClicked(void) throw () -{ - // TODO: add confirmation dialog - hide(); -} - - -/*------------------------------------------------------------------------------ - * The event when the OK button has been clicked. - *----------------------------------------------------------------------------*/ -void -RestoreBackupWindow :: onOkButtonClicked(void) throw () -{ - hide(); -} - - -/*------------------------------------------------------------------------------ - * Display a localized message in the window. - *----------------------------------------------------------------------------*/ -inline void -RestoreBackupWindow :: displayMessage(const Glib::ustring & messageKey) - throw () -{ - setLabelText(*getResourceUstring(messageKey)); -} - - -/*------------------------------------------------------------------------------ - * Display a localized message in the window, with one argument. - *----------------------------------------------------------------------------*/ -inline void -RestoreBackupWindow :: displayMessage(const Glib::ustring & messageKey, - const Glib::ustring & argument) - throw () -{ - setLabelText(*formatMessage(messageKey, argument)); -} - - -/*------------------------------------------------------------------------------ - * Display an error message in the window. - *----------------------------------------------------------------------------*/ -inline void -RestoreBackupWindow :: signalError(const Glib::ustring & errorMessage) - throw () -{ - currentState = AsyncState::failedState; - displayMessage("errorMessage", errorMessage); - restoreBackupClose(); -} - - -/*------------------------------------------------------------------------------ - * Start the upload. - *----------------------------------------------------------------------------*/ -void -RestoreBackupWindow :: restoreBackupOpen(void) throw () -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - try { - token = storage->restoreBackupOpen(sessionId, fileName); - - } catch (XmlRpcException &e) { - signalError(e.what()); - return; - } - - currentState = AsyncState::pendingState; - displayMessage("pendingMessage", *fileName); - setTimer(); -} - - -/*------------------------------------------------------------------------------ - * Check on the upload. - *----------------------------------------------------------------------------*/ -void -RestoreBackupWindow :: restoreBackupCheck(void) throw () -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - - Ptr::Ref errorMessage; - try { - currentState = storage->restoreBackupCheck(*token, errorMessage); - - } catch (XmlRpcException &e) { - signalError(e.what()); - return; - } - - if (currentState == AsyncState::finishedState) { - displayMessage("finishedMessage"); - restoreBackupClose(); - - } else if (currentState == AsyncState::failedState) { - displayMessage("errorMessage", - *errorMessage); - restoreBackupClose(); - } -} - - -/*------------------------------------------------------------------------------ - * Close the upload. - *----------------------------------------------------------------------------*/ -void -RestoreBackupWindow :: restoreBackupClose(void) throw () -{ - if (token) { - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - - try { - storage->restoreBackupClose(*token); - token.reset(); - - } catch (XmlRpcException &e) { - signalError(e.what()); - return; - } - } - - resetTimer(); - okButton->set_sensitive(true); -} - - -/*------------------------------------------------------------------------------ - * The function which is called regularly when the timer is set. - *----------------------------------------------------------------------------*/ -bool -RestoreBackupWindow :: onUpdateTime(void) throw () -{ - if (currentState == AsyncState::pendingState) { - restoreBackupCheck(); - } - return true; -} - - -/*------------------------------------------------------------------------------ - * Connect the timer. - *----------------------------------------------------------------------------*/ -inline void -RestoreBackupWindow :: setTimer(void) throw () -{ - timer.reset(new sigc::connection(Glib::signal_timeout().connect( - sigc::mem_fun( - *this, - &RestoreBackupWindow::onUpdateTime), - timerInterval))); -} - - -/*------------------------------------------------------------------------------ - * Disconnect the timer. - *----------------------------------------------------------------------------*/ -inline void -RestoreBackupWindow :: resetTimer(void) throw () -{ - timer->disconnect(); -} - - -/*------------------------------------------------------------------------------ - * Close the connection and hide the window. - *----------------------------------------------------------------------------*/ -void -RestoreBackupWindow :: hide(void) throw () -{ - restoreBackupClose(); - GuiWindow::hide(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for closing the window from the window manager. - *----------------------------------------------------------------------------*/ -bool -RestoreBackupWindow :: onDeleteEvent(GdkEventAny * event) throw () -{ - restoreBackupClose(); - return false; -} - diff --git a/src/products/gLiveSupport/src/RestoreBackupWindow.h b/src/products/gLiveSupport/src/RestoreBackupWindow.h deleted file mode 100644 index e4e49af1a..000000000 --- a/src/products/gLiveSupport/src/RestoreBackupWindow.h +++ /dev/null @@ -1,242 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RestoreBackupWindow_h -#define RestoreBackupWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "GLiveSupport.h" - -#include "GuiWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A pop-up window displaying the progress of a restore backup task. - * - */ -class RestoreBackupWindow : public GuiWindow -{ - private: - - /** - * The label holding the current message displayed by the window. - */ - Gtk::Label * messageLabel; - - /** - * The OK button. - */ - Gtk::Button * okButton; - - /** - * The file name of the backup file to be uploaded. - */ - Ptr::Ref fileName; - - /** - * The current state of the upload task. - */ - AsyncState currentState; - - /** - * The token of the upload task. - */ - Ptr::Ref token; - - /** - * The connection object to the timer signal. - */ - Ptr::Ref timer; - - - protected: - - /** - * Event handler for the cancel button being clicked. - */ - virtual void - onCancelButtonClicked(void) throw (); - - /** - * Event handler for the ok button being clicked. - */ - virtual void - onOkButtonClicked(void) throw (); - - /** - * Event handler for closing the window from the window manager. - * Calls StorageClientInterface::restoreBackupClose(). - * - * Overrides GuiWindow::onDeleteEvent(). - * - * @param event attributes of the event. - * @return true if handled the event, false to continue deleting. - */ - virtual bool - onDeleteEvent(GdkEventAny * event) throw (); - - /** - * Set the text of the label. - * - * @param text the new text of the label. - */ - virtual void - setLabelText(const Glib::ustring & text) throw () - { - messageLabel->set_text(text); - } - - /** - * Display a localized message in the window. - * - * @param messageKey the localization key of the message. - */ - virtual void - displayMessage(const Glib::ustring & messageKey) throw (); - - /** - * Display a localized message in the window, with one argument. - * - * @param messageKey the localization key of the message. - * @param argument the string to substitute for {0}. - */ - virtual void - displayMessage(const Glib::ustring & messageKey, - const Glib::ustring & argument) throw (); - - /** - * Signal an error. - * Prints the error message, sets the internal state to failedState, - * and re-sensitizes the OK button. - * - * @param errorMessage the error message to be displayed. - */ - virtual void - signalError(const Glib::ustring & errorMessage) throw (); - - /** - * Call the restoreBackupOpen function in the storage client. - */ - virtual void - restoreBackupOpen(void) throw (); - - /** - * Call the restoreBackupCheck function in the storage client. - */ - virtual void - restoreBackupCheck(void) throw (); - - /** - * Call the restoreBackupClose function in the storage client. - */ - virtual void - restoreBackupClose(void) throw (); - - /** - * The function which is called regularly when the timer is set. - * - * This is just a wrapper for restoreBackupCheck(), with a bool - * return value (always true), because Glib::signal_timeout expects - * a sigc::slot0. - * TODO: figure out what this return value does. - */ - virtual bool - onUpdateTime(void) throw (); - - /** - * Connect the timer. - */ - virtual void - setTimer(void) throw (); - - /** - * Disconnect the timer. - */ - virtual void - resetTimer(void) throw (); - - - public: - - /** - * Constructor. - * - * @param fileName the file name of the backup to be restored. - */ - RestoreBackupWindow(Ptr::Ref fileName) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~RestoreBackupWindow(void) throw () - { - } - - /** - * Close the connection and hide the window. - * Calls StorageClientInterface::restoreBackupClose(). - * - * Overrides GuiWindow::hide(). - */ - virtual void - hide(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // RestoreBackupWindow_h - diff --git a/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx b/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx deleted file mode 100644 index 8834669dd..000000000 --- a/src/products/gLiveSupport/src/SchedulePlaylistWindow.cxx +++ /dev/null @@ -1,137 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include "boost/date_time/posix_time/posix_time.hpp" - -#include "LiveSupport/Core/TimeConversion.h" - -#include "SchedulePlaylistWindow.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "schedulePlaylistWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "SchedulePlaylistWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -SchedulePlaylistWindow :: SchedulePlaylistWindow (Ptr::Ref playlist) - throw () - : GuiWindow(bundleName, - gladeFileName), - playlist(playlist) -{ - Gtk::Label * playlistLabel; - glade->get_widget("playlistLabel1", playlistLabel); - playlistLabel->set_label(*playlist->getTitle()); - - Gtk::Label * hourLabel; - Gtk::Label * minuteLabel; - Gtk::Label * secondLabel; - glade->get_widget("hourLabel1", hourLabel); - glade->get_widget("minuteLabel1", minuteLabel); - glade->get_widget("secondLabel1", secondLabel); - hourLabel->set_label(*getResourceUstring("hourLabel")); - minuteLabel->set_label(*getResourceUstring("minuteLabel")); - secondLabel->set_label(*getResourceUstring("secondLabel")); - - glade->get_widget("calendar1", calendar); - - glade->get_widget("hourSpinButton1", hourEntry); - glade->get_widget("minuteSpinButton1", minuteEntry); - glade->get_widget("secondSpinButton1", secondEntry); - Ptr::Ref now = TimeConversion::now(); - boost::posix_time::time_duration time = now->time_of_day(); - hourEntry->set_value(time.hours()); - minuteEntry->set_value(time.minutes() + 1); - secondEntry->set_value(0); - - Gtk::Button * scheduleButton; - glade->get_widget("scheduleButton1", scheduleButton); - scheduleButton->set_label(*getResourceUstring("scheduleButtonLabel")); - scheduleButton->signal_clicked().connect(sigc::mem_fun(*this, - &SchedulePlaylistWindow::onScheduleButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the schedule button getting clicked. - *----------------------------------------------------------------------------*/ -void -SchedulePlaylistWindow :: onScheduleButtonClicked (void) throw () -{ - unsigned int year; - unsigned int month; - unsigned int day; - calendar->get_date(year, month, day); - ++month; // Gtk+ months are 0-based, Boost months are 1-based - - int hours = hourEntry->get_value_as_int(); - int minutes = minuteEntry->get_value_as_int(); - int seconds = secondEntry->get_value_as_int(); - - Ptr::Ref dateTime(new boost::posix_time::ptime( - boost::gregorian::date(year, month, day), - boost::posix_time::time_duration(hours, minutes, seconds) )); - - try { - gLiveSupport->schedulePlaylist(playlist, dateTime); - } catch (XmlRpcException &e) { - // TODO: notify user - std::cerr << "scheduling problem: " << e.what() << std::endl; - return; - } - - mainWindow->hide(); -} - diff --git a/src/products/gLiveSupport/src/SchedulePlaylistWindow.h b/src/products/gLiveSupport/src/SchedulePlaylistWindow.h deleted file mode 100644 index 6b15058fc..000000000 --- a/src/products/gLiveSupport/src/SchedulePlaylistWindow.h +++ /dev/null @@ -1,145 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SchedulePlaylistWindow_h -#define SchedulePlaylistWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "GLiveSupport.h" - -#include "GuiWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The window, for scheduling a specific playlist. - * - * The rough layout of the window is: - *
- *  +--- scheduler window ----------------------------+
- *  | +--- plalyist name ---------------------------+ |
- *  | +--- calendar --------------------------------+ |
- *  | |                                             | |
- *  | +---------------------------------------------+ |
- *  | +--- time input ------------------------------+ |
- *  | | hour: +- hour -+  minute: +- minute -+      | |
- *  | +---------------------------------------------+ |
- *  | +-- schedule button --------------------------+ |
- *  | +-- close button -----------------------------+ |
- *  +-------------------------------------------------+
- *  
- * - */ -class SchedulePlaylistWindow : public GuiWindow -{ - private: - - /** - * The playlist to schedule. - */ - Ptr::Ref playlist; - - /** - * The calendar to select a specific date from. - */ - Gtk::Calendar * calendar; - - /** - * The entry field for hours. - */ - Gtk::SpinButton * hourEntry; - - /** - * The entry field for minutes. - */ - Gtk::SpinButton * minuteEntry; - - /** - * The entry field for seconds. - */ - Gtk::SpinButton * secondEntry; - - - protected: - - /** - * Event handler for the schedule button clicked. - */ - virtual void - onScheduleButtonClicked(void) throw (); - - - public: - - /** - * Constructor. - * - * @param playlist the playlist to schedule. - */ - SchedulePlaylistWindow(Ptr::Ref playlist) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~SchedulePlaylistWindow(void) throw () - { - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // SchedulePlaylistWindow_h - diff --git a/src/products/gLiveSupport/src/SchedulerWindow.cxx b/src/products/gLiveSupport/src/SchedulerWindow.cxx deleted file mode 100644 index 72b070fa0..000000000 --- a/src/products/gLiveSupport/src/SchedulerWindow.cxx +++ /dev/null @@ -1,369 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "SchedulerWindow.h" - - -using namespace boost; -using namespace Glib; - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "schedulerWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "SchedulerWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -SchedulerWindow :: SchedulerWindow ( - Gtk::ToggleButton * windowOpenerButton) - throw (XmlRpcException) - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton) -{ - constructScheduleView(); - constructStatusView(); - - Gtk::Label * scheduleTabLabel; - Gtk::Label * statusTabLabel; - glade->get_widget("scheduleTabLabel1", scheduleTabLabel); - glade->get_widget("statusTabLabel1", statusTabLabel); - scheduleTabLabel->set_label(*getResourceUstring("scheduleTab")); - statusTabLabel->set_label(*getResourceUstring("statusTab")); - - glade->connect_clicked("closeButton1", sigc::mem_fun(*this, - &SchedulerWindow::hide)); - - showContents(); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -SchedulerWindow :: ~SchedulerWindow (void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Construct the Schedule view. - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: constructScheduleView(void) throw () -{ - glade->get_widget("calendar1", calendar); - glade->get_widget("dateLabel1", dateLabel); - - // create the tree view for the entries - entriesModel = Gtk::ListStore::create(entryColumns); - glade->get_widget_derived("entriesTreeView1", entriesTreeView); - entriesTreeView->set_model(entriesModel); - entriesTreeView->connectModelSignals(entriesModel); - - entriesTreeView->append_column(*getResourceUstring("startColumnLabel"), - entryColumns.startColumn); - entriesTreeView->append_column(*getResourceUstring("titleColumnLabel"), - entryColumns.titleColumn); - entriesTreeView->append_column(*getResourceUstring("endColumnLabel"), - entryColumns.endColumn); - - // register the signal handler for entries view entries being clicked - entriesTreeView->signal_button_press_event().connect_notify( - sigc::mem_fun(*this, - &SchedulerWindow::onEntryClicked)); - - // create the right-click entry context menu - entryMenu.reset(new Gtk::Menu()); - Gtk::Menu::MenuList& menuList = entryMenu->items(); - menuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("deleteMenuItem"), - sigc::mem_fun(*this, - &SchedulerWindow::onDeleteItem))); - entryMenu->accelerate(*mainWindow); - - // register the signal handle for when a date is selected in the calendar - calendar->signal_day_selected().connect(sigc::mem_fun(*this, - &SchedulerWindow::onDateSelected)); - - // initialize the selected date for today - selectedDate.reset(new gregorian::date(TimeConversion::now()->date())); -} - - -/*------------------------------------------------------------------------------ - * Construct the Status view. - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: constructStatusView(void) throw () -{ - Gtk::Label * stopCurrentlyPlayingLabel; - Gtk::Button * stopCurrentlyPlayingButton; - glade->get_widget("stopCurrentlyPlayingLabel1", stopCurrentlyPlayingLabel); - glade->get_widget("stopCurrentlyPlayingButton1", - stopCurrentlyPlayingButton); - stopCurrentlyPlayingLabel->set_label( - *getResourceUstring("stopCurrentlyPlayingText")); - stopCurrentlyPlayingButton->set_label( - *getResourceUstring("stopCurrentlyPlayingButtonLabel")); - stopCurrentlyPlayingButton->signal_clicked().connect(sigc::mem_fun(*this, - &SchedulerWindow::onStopCurrentlyPlayingButtonClicked)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for a date being selected on the calendar - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: onDateSelected (void) throw () -{ - guint year; - guint month; - guint day; - - calendar->get_date(year, month, day); - - try { - Ptr::Ref date(new gregorian::date(year, month+1, day)); - if (*date != *selectedDate) { - selectedDate = date; - showContents(); - } - } catch (std::out_of_range &e) { - // TODO: report date out of range error - std::cerr << e.what() << std::endl; - } catch (XmlRpcException &e) { - // TODO: report storage server error - std::cerr << e.what() << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Move the time to be displayed to the specified time. - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: setTime(Ptr::Ref time) - throw () -{ - selectedDate.reset(new gregorian::date(time->date())); -} - - -/*------------------------------------------------------------------------------ - * Update the contents of the display, with regards to the currently selected - * date - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: showContents(void) throw (XmlRpcException) -{ - calendar->select_month(selectedDate->month() - 1, selectedDate->year()); - calendar->select_day(selectedDate->day()); - - dateLabel->set_text(to_simple_string(*selectedDate)); - - Ptr::Ref> >::Ref entries; - std::vector::Ref>::iterator it; - std::vector::Ref>::iterator end; - Ptr::Ref from; - Ptr::Ref to; - Ptr::Ref midnight; - - // we're interested from midnight, selectedDate, to midnight, the next day - midnight.reset(new posix_time::time_duration(0, 0, 0, 0)); - from.reset(new posix_time::ptime(*selectedDate, *midnight)); - to.reset(new posix_time::ptime(*selectedDate + gregorian::date_duration(1), - *midnight)); - - entries = gLiveSupport->displaySchedule(from, to); - - it = entries->begin(); - end = entries->end(); - entriesModel->clear(); - while (it != end) { - Ptr::Ref playlist; - Ptr::Ref entry = *it; - Ptr::Ref playlistId(new UniqueId( - entry->getPlaylistId()->getId())); - - if (!gLiveSupport->existsPlaylist(playlistId)) { - ++it; - continue; - } - - playlist = gLiveSupport->getPlaylist(playlistId); - - Gtk::TreeModel::Row row = *(entriesModel->append()); - - row[entryColumns.idColumn] = entry->getId(); - row[entryColumns.startColumn] = - to_simple_string(*entry->getStartTime()); - row[entryColumns.titleColumn] = *playlist->getTitle(); - row[entryColumns.endColumn] = to_simple_string(*entry->getEndTime()); - - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for an entry being clicked in the list - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: onEntryClicked (GdkEventButton * event) throw () -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - // only show the context menu, if something is already selected - Glib::RefPtr refSelection = - entriesTreeView->get_selection(); - if (refSelection) { - Gtk::TreeModel::iterator iter = refSelection->get_selected(); - if (iter) { - entryMenu->popup(event->button, event->time); - } - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Delete menu item selected from the entry context menu - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: onDeleteItem(void) throw () -{ - Glib::RefPtr refSelection = - entriesTreeView->get_selection(); - - if (refSelection) { - Gtk::TreeModel::iterator iter = refSelection->get_selected(); - if (iter) { - Ptr::Ref entryId = (*iter)[entryColumns.idColumn]; - - try { - gLiveSupport->removeFromSchedule(entryId); - } catch (XmlRpcException &e) { - // TODO: signal error here - } - - try { - showContents(); - } catch (XmlRpcException &e) { - // TODO: signal error here - } - } - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the "stop currently playing" button getting clicked. - *----------------------------------------------------------------------------*/ -void -SchedulerWindow :: onStopCurrentlyPlayingButtonClicked(void) throw () -{ - Gtk::ResponseType result = runConfirmationDialog(); - switch (result) { - case Gtk::RESPONSE_YES: - break; - - case Gtk::RESPONSE_NO: - return; - break; - - default : // can happen if the window - return; // is closed with Alt-F4 - break; // -- treated as No - } - - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - Ptr::Ref - scheduler = gLiveSupport->getScheduler(); - - try { - scheduler->stopCurrentlyPlaying(sessionId); - - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(e.what()); - } - - showContents(); -} - - -/*------------------------------------------------------------------------------ - * Run the confirmation window. - *----------------------------------------------------------------------------*/ -Gtk::ResponseType -SchedulerWindow :: runConfirmationDialog(void) throw () -{ - Gtk::Dialog * confirmationDialog; - Gtk::Label * confirmationDialogLabel; - glade->get_widget("confirmationDialog1", confirmationDialog); - glade->get_widget("confirmationDialogLabel1", confirmationDialogLabel); - - Glib::ustring message = ""; - message += *getResourceUstring("stopCurrentlyPlayingDialogMsg"); - message += ""; - confirmationDialogLabel->set_label(message); - - Gtk::ResponseType response = Gtk::ResponseType( - confirmationDialog->run()); - confirmationDialog->hide(); - return response; -} - diff --git a/src/products/gLiveSupport/src/SchedulerWindow.h b/src/products/gLiveSupport/src/SchedulerWindow.h deleted file mode 100644 index 5a0954182..000000000 --- a/src/products/gLiveSupport/src/SchedulerWindow.h +++ /dev/null @@ -1,266 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SchedulerWindow_h -#define SchedulerWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "GuiWindow.h" -#include "GLiveSupport.h" - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The Scheduler window, showing and allowing scheduling of playlists. - * - * The window is tabbed, with a main Schedule tab, and a Status tab showing - * the status of the scheduler daemon (running/stopped). In the Status tab, - * one can send a Stop signal to the Scheduler, to stop the audio player. - * - * The rough layout of the Schedule tab: - *
- *  +--- scheduler window ----------------------------+
- *  | +--- calendar --------------------------------+ |
- *  | |                                             | |
- *  | +---------------------------------------------+ |
- *  | +--- the selected day ------------------------+ |
- *  | +--- entires for the selected day ------------+ |
- *  | | +--- entry 1 -----------------------------+ | |
- *  | | | +-- start --+ +-- title --+ +-- end --+ | | |
- *  | | +-----------------------------------------+ | |
- *  | | +--- entry 2 -----------------------------+ | |
- *  | | | +-- start --+ +-- title --+ +-- end --+ | | |
- *  | | +-----------------------------------------+ | |
- *  | +---------------------------------------------+ |
- *  | +-- close button -----------------------------+ |
- *  +-------------------------------------------------+
- *  
- * - */ -class SchedulerWindow : public GuiWindow -{ - private: - - /** - * Construct the Schedule view. - * This displays the list of scheduled playlists. - */ - void - constructScheduleView(void) throw (); - - /** - * Construct the Status view. - * This shows the status of the scheduler daemon. - */ - void - constructStatusView(void) throw (); - - /** - * Run the confirmation dialog. - * - * @return the response ID returned by the dialog. - */ - Gtk::ResponseType - runConfirmationDialog(void) throw (); - - - protected: - - /** - * The columns model needed by Gtk::TreeView. - * Lists one scheduled item per row. - * - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - /** - * The column for the id of the playlist. - */ - Gtk::TreeModelColumn::Ref> idColumn; - - /** - * The column for the start of the playlist. - */ - Gtk::TreeModelColumn startColumn; - - /** - * The column for the title of the playlist. - */ - Gtk::TreeModelColumn titleColumn; - - /** - * The column for the end of the playlist. - */ - Gtk::TreeModelColumn endColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(idColumn); - add(startColumn); - add(titleColumn); - add(endColumn); - } - }; - - - /** - * The date selected for display. - */ - Ptr::Ref selectedDate; - - /** - * The calendar to select a specific date from. - */ - Gtk::Calendar * calendar; - - /** - * The label saying which day is being displayed. - */ - Gtk::Label * dateLabel; - - /** - * The column model. - */ - ModelColumns entryColumns; - - /** - * The tree view, now only showing rows, each scheduled entry for a - * specific day. - */ - ZebraTreeView * entriesTreeView; - - /** - * The tree model, as a GTK reference. - */ - Glib::RefPtr entriesModel; - - /** - * The right-click context menu for schedule entries. - */ - Ptr::Ref entryMenu; - - /** - * Signal handler for when a date is selected in the calendar. - */ - virtual void - onDateSelected(void) throw (); - - /** - * Signal handler for the mouse clicked on one of the entries. - * - * @param event the button event recieved - */ - virtual void - onEntryClicked(GdkEventButton * event) throw (); - - /** - * Signal handler for the "delete" menu item selected from - * the entry context menu. - */ - virtual void - onDeleteItem(void) throw (); - - /** - * Signal handler for the "stop currently playing" button - * getting clicked. - */ - virtual void - onStopCurrentlyPlayingButtonClicked(void) throw (); - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - SchedulerWindow(Gtk::ToggleButton * windowOpenerButton) - throw (XmlRpcException); - - /** - * Virtual destructor. - */ - virtual - ~SchedulerWindow(void) throw (); - - /** - * Select a specific timepoint to display. - * Call showContents() after this call. - * - * @param time display the schedule around this timepoint. - * @see #showContents - */ - virtual void - setTime(Ptr::Ref time) throw (); - - /** - * Update the display, with regards to the currently selected day. - */ - virtual void - showContents(void) throw (XmlRpcException); - -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // SchedulerWindow_h - diff --git a/src/products/gLiveSupport/src/ScratchpadWindow.cxx b/src/products/gLiveSupport/src/ScratchpadWindow.cxx deleted file mode 100644 index 6cdbdf0ad..000000000 --- a/src/products/gLiveSupport/src/ScratchpadWindow.cxx +++ /dev/null @@ -1,673 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Widgets/WidgetFactory.h" - -#include "ScratchpadWindow.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "scratchpadWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "ScratchpadWindow.glade"; - -/*------------------------------------------------------------------------------ - * The name of the user preference for storing Scratchpad contents - *----------------------------------------------------------------------------*/ -const Glib::ustring userPreferencesKeyName = "scratchpadContents"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -ScratchpadWindow :: ScratchpadWindow ( - Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton) -{ - // create the tree view - glade->get_widget_derived("treeView1", treeView); - treeView->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); - - treeView->appendColumn("", - modelColumns.typeColumn); - treeView->appendColumn(*getResourceUstring("creatorColumnLabel"), - modelColumns.creatorColumn); - treeView->appendColumn(*getResourceUstring("titleColumnLabel"), - modelColumns.titleColumn); - - treeModel = Gtk::ListStore::create(modelColumns); - treeView->set_model(treeModel); - treeView->connectModelSignals(treeModel); - setupDndCallbacks(); - - // register the signal handlers for treeview - treeView->signal_button_press_event().connect(sigc::mem_fun(*this, - &ScratchpadWindow::onEntryClicked), - false /* call this first */); - treeView->signal_row_activated().connect(sigc::mem_fun(*this, - &ScratchpadWindow::onDoubleClick)); - treeView->signal_key_press_event().connect(sigc::mem_fun(*this, - &ScratchpadWindow::onKeyPressed)); - - // create the cue player widget - cuePlayer.reset(new CuePlayer(this, - treeView, - modelColumns)); - - // create the right-click entry context menu for audio clips - audioClipContextMenu.reset(new Gtk::Menu()); - audioClipContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("cueMenuItem"), - sigc::mem_fun(*cuePlayer, - &CuePlayer::onPlayItem))); - audioClipContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToLiveModeMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onAddToLiveMode))); - audioClipContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToPlaylistMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onAddToPlaylist))); - audioClipContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("removeMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onRemoveMenuOption))); - audioClipContextMenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem()); - audioClipContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("uploadToHubMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onUploadToHub))); - audioClipContextMenu->accelerate(*mainWindow); - - // create the right-click entry context menu for playlists - playlistContextMenu.reset(new Gtk::Menu()); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("cueMenuItem"), - sigc::mem_fun(*cuePlayer, - &CuePlayer::onPlayItem))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToLiveModeMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onAddToLiveMode))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToPlaylistMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onAddToPlaylist))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("removeMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onRemoveMenuOption))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem()); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("editPlaylistMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onEditPlaylist))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("schedulePlaylistMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onSchedulePlaylist))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("exportPlaylistMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onExportPlaylist))); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::SeparatorElem()); - playlistContextMenu->items().push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("uploadToHubMenuItem"), - sigc::mem_fun(*this, - &ScratchpadWindow::onUploadToHub))); - playlistContextMenu->accelerate(*mainWindow); - - // set the user preferences key - userPreferencesKey.reset(new const Glib::ustring(userPreferencesKeyName)); -} - - -/*------------------------------------------------------------------------------ - * Event handler for an entry being clicked in the list - *----------------------------------------------------------------------------*/ -bool -ScratchpadWindow :: onEntryClicked (GdkEventButton * event) throw () -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - Ptr::Ref playable = getFirstSelectedPlayable(); - - if (selectedPaths->size() == 1) { - if (playable->getType() == Playable::AudioClipType) { - audioClipContextMenu->popup(event->button, event->time); - return true; - - } else if (playable->getType() == Playable::PlaylistType) { - playlistContextMenu->popup(event->button, event->time); - return true; - } - - } else if (selectedPaths->size() > 1) { - audioClipContextMenu->popup(event->button, event->time); - return true; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Return the first selected playable item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -ScratchpadWindow :: getFirstSelectedPlayable(void) throw () -{ - Ptr::Ref playable; - - Glib::RefPtr - selection = treeView->get_selection(); - selectedPaths.reset(new std::vector( - selection->get_selected_rows())); - - if (selectedPaths->size() > 0) { - selectedIter = selectedPaths->begin(); - Gtk::TreeRow row = *(treeModel->get_iter(*selectedIter)); - playable = row[modelColumns.playableColumn]; - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Return the next selected playable item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -ScratchpadWindow :: getNextSelectedPlayable(void) throw () -{ - Ptr::Ref playable; - - if (selectedPaths) { - if (selectedIter != selectedPaths->end()) { - Gtk::TreeRow row = *(treeModel->get_iter(*selectedIter)); - playable = row[modelColumns.playableColumn]; - ++selectedIter; - } else { - selectedPaths.reset(); - } - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Remove an item from the Scratchpad - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: removeItem(Ptr::Ref id) throw () -{ - Gtk::TreeModel::const_iterator it; - - for (it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - - Gtk::TreeRow row = *it; - Ptr::Ref currentPlayable = row[modelColumns.playableColumn]; - - if (*id == *currentPlayable->getId()) { - treeModel->erase(it); - return; - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Edit Playlist menu item selected from the - * entry context menu - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onEditPlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - - try { - gLiveSupport->openPlaylistForEditing(playable->getId()); - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(*getResourceUstring( - "cannotEditPlaylistMsg" )); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Schedule Playlist menu item selected from the - * entry context menu - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onSchedulePlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - schedulePlaylistWindow.reset(new SchedulePlaylistWindow(playlist)); - schedulePlaylistWindow->getWindow()->set_transient_for(*mainWindow); - Gtk::Main::run(*schedulePlaylistWindow->getWindow()); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "export playlist" in the context menu. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onExportPlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - exportPlaylistWindow.reset(new ExportPlaylistWindow(playlist)); - exportPlaylistWindow->getWindow()->set_transient_for(*mainWindow); - Gtk::Main::run(*exportPlaylistWindow->getWindow()); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Add To Playlist menu item selected from the - * entry context menu - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onAddToPlaylist(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - try { - gLiveSupport->addToPlaylist(playable->getId()); - } catch (XmlRpcException &e) { - std::cerr << "error in ScratchpadWindow::onAddToPlaylist(): " - << e.what() << std::endl; - return; - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Add To Live Mode menu item selected from the - * entry context menu - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onAddToLiveMode(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - gLiveSupport->addToLiveMode(playable); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "upload to hub" in the context menu. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onUploadToHub(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - gLiveSupport->uploadToHub(playable); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Remove menu item selected from the context menu. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onRemoveMenuOption(void) throw () -{ - Glib::RefPtr selection - = treeView->get_selection(); - std::vector selectedPaths - = selection->get_selected_rows(); - - std::vector selectedIters; - for (std::vector::iterator pathIt = selectedPaths.begin(); - pathIt != selectedPaths.end(); - ++pathIt) { - selectedIters.push_back(treeModel->get_iter(*pathIt)); - } - - Gtk::TreeModel::iterator newSelection; - for (std::vector::iterator - iterIt = selectedIters.begin(); - iterIt != selectedIters.end(); - ++iterIt) { - newSelection = *iterIt; - ++newSelection; - treeModel->erase(*iterIt); - } - - if (newSelection) { - selection->select(newSelection); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the user double-clicking or pressing Enter. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: onDoubleClick(const Gtk::TreeModel::Path & path, - const Gtk::TreeViewColumn * column) - throw () -{ - Ptr::Ref playable = getFirstSelectedPlayable(); - - if (playable) { - onAddToLiveMode(); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for a key pressed. - *----------------------------------------------------------------------------*/ -bool -ScratchpadWindow :: onKeyPressed(GdkEventKey * event) throw () -{ - if (event->type == GDK_KEY_PRESS) { - KeyboardShortcut::Action action = gLiveSupport->findAction( - "scratchpadWindow", - Gdk::ModifierType(event->state), - event->keyval); - switch (action) { - case KeyboardShortcut::moveItemUp : - if (selectionIsSingle()) { - treeView->onUpMenuOption(); - return true; - } - break; - - case KeyboardShortcut::moveItemDown : - if (selectionIsSingle()) { - treeView->onDownMenuOption(); - return true; - } - break; - - case KeyboardShortcut::removeItem : - onRemoveMenuOption(); - return true; - break; - - default : break; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Check whether exactly one row is selected. - *----------------------------------------------------------------------------*/ -bool -ScratchpadWindow :: selectionIsSingle(void) throw () -{ - getFirstSelectedPlayable(); - - return (selectedPaths->size() == 1); -} - - -/*------------------------------------------------------------------------------ - * Add an item to the Scratchpad. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: addItem(Ptr::Ref playable) - throw () -{ - // cache the item if it hasn't been cached yet - if (!playable->getToken()) { - try { - playable = gLiveSupport->acquirePlayable(playable->getId()); - } catch (XmlRpcException &e) { - std::cerr << "could not acquire playable in ScratchpadWindow: " - << e.what() << std::endl; - return; - } - } - - removeItem(playable->getId()); - - Gtk::TreeModel::Row row = *(treeModel->prepend()); - - row[modelColumns.playableColumn] = playable; - - Ptr::Ref widgetFactory = WidgetFactory::getInstance(); - - switch (playable->getType()) { - case Playable::AudioClipType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetConstants::audioClipIconImage); - break; - - case Playable::PlaylistType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetConstants::playlistIconImage); - break; - } - - Ptr::Ref creator = playable->getMetadata( - "dc:creator"); - if (creator) { - row[modelColumns.creatorColumn] = Glib::Markup::escape_text( - *creator); - } - row[modelColumns.titleColumn] = Glib::Markup::escape_text( - *playable->getTitle()); -} - - -/*------------------------------------------------------------------------------ - * Add an item to the Scratchpad. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: addItem(Ptr::Ref id) - throw () -{ - Ptr::Ref playable; - try { - playable = gLiveSupport->acquirePlayable(id); - } catch (XmlRpcException &e) { - std::cerr << "could not acquire playable in ScratchpadWindow: " - << e.what() << std::endl; - return; - } - - addItem(playable); -} - - -/*------------------------------------------------------------------------------ - * Return the contents of the Scratchpad. - *----------------------------------------------------------------------------*/ -Ptr::Ref -ScratchpadWindow :: getContents(void) throw () -{ - std::ostringstream contentsStream; - Gtk::TreeModel::const_iterator it; - - for (it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - Gtk::TreeRow row = *it; - Ptr::Ref playable = row[modelColumns.playableColumn]; - contentsStream << playable->getId()->getId() << " "; - } - - Ptr::Ref contents(new Glib::ustring( - contentsStream.str() )); - return contents; -} - - -/*------------------------------------------------------------------------------ - * Restore the contents of the Scratchpad. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: setContents(Ptr::Ref contents) - throw () -{ - std::vector contentsVector; - std::istringstream contentsStream(*contents); - while (!contentsStream.eof()) { - UniqueId::IdType nextItem; - contentsStream >> nextItem; - if (contentsStream.fail()) { - contentsStream.clear(); - contentsStream.ignore(); - } else { - contentsVector.push_back(nextItem); - } - } - - treeModel->clear(); - std::vector::reverse_iterator it; - - for (it = contentsVector.rbegin(); it != contentsVector.rend(); ++it) { - Ptr::Ref id(new const UniqueId(*it)); - addItem(id); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler called when the the window gets hidden. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: hide(void) throw () -{ - if (exportPlaylistWindow) { - exportPlaylistWindow->getWindow()->hide(); - } - if (schedulePlaylistWindow) { - schedulePlaylistWindow->getWindow()->hide(); - } - - GuiWindow::hide(); -} - - -/*------------------------------------------------------------------------------ - * The name of the window for the d'n'd methods. - *----------------------------------------------------------------------------*/ -Glib::ustring -ScratchpadWindow :: getWindowNameForDnd (void) throw () -{ - return bundleName; -} - - -/*------------------------------------------------------------------------------ - * Add an item to the Scratchpad at the given position. - *----------------------------------------------------------------------------*/ -void -ScratchpadWindow :: addItem(Gtk::TreeIter iter, - Ptr::Ref id) - throw () -{ - Ptr::Ref playable; - try { - playable = gLiveSupport->acquirePlayable(id); - } catch (XmlRpcException &e) { - std::cerr << "could not acquire playable in ScratchpadWindow: " - << e.what() << std::endl; - return; - } - - Gtk::TreeModel::Row row = *iter; - - row[modelColumns.playableColumn] = playable; - - Ptr::Ref widgetFactory = WidgetFactory::getInstance(); - - switch (playable->getType()) { - case Playable::AudioClipType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetConstants::audioClipIconImage); - break; - - case Playable::PlaylistType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetConstants::playlistIconImage); - break; - } - - Ptr::Ref creator = playable->getMetadata( - "dc:creator"); - if (creator) { - row[modelColumns.creatorColumn] = Glib::Markup::escape_text( - *creator); - } - row[modelColumns.titleColumn] = Glib::Markup::escape_text( - *playable->getTitle()); -} - - diff --git a/src/products/gLiveSupport/src/ScratchpadWindow.h b/src/products/gLiveSupport/src/ScratchpadWindow.h deleted file mode 100644 index aef23d991..000000000 --- a/src/products/gLiveSupport/src/ScratchpadWindow.h +++ /dev/null @@ -1,424 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ScratchpadWindow_h -#define ScratchpadWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "GuiWindow.h" -#include "ContentsStorable.h" -#include "DndMethods.h" - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "CuePlayer.h" -#include "ExportPlaylistWindow.h" -#include "SchedulePlaylistWindow.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The Scratchpad window, showing recent and relevant audio clips and - * playlists. - * - */ -class ScratchpadWindow : public GuiWindow, - public ContentsStorable, - public DndMethods -{ - private: - - /** - * The user preferences key. - */ - Ptr::Ref userPreferencesKey; - - /** - * The Export Playlist pop-up window. - */ - Ptr::Ref exportPlaylistWindow; - - /** - * The Schedule Playlist pop-up window. - */ - Ptr::Ref schedulePlaylistWindow; - - /** - * The list of selected rows, as path references (row numbers). - * Reset by onEntryClicked(). - */ - Ptr >::Ref selectedPaths; - /** - * One of the selected rows, set to the first one by onEntryClicked(). - * Incremented by getNextSelectedPlayable(). - */ - std::vector::const_iterator selectedIter; - - /** - * Check whether exactly one row is selected. - * - * This is an auxilliary function used by onKeyPressed(). - * - * @return true if a single row is selected, false if not. - */ - bool - selectionIsSingle(void) throw (); - - /** - * Remove an item from the Scratchpad. - * If an item with the specified unique ID is found, it is removed. - * (There should never be more than one entry with the same ID; - * if there are, then only the first one is removed.) - * If no such item is found, the function does nothing. - * - * @param id the id of the item to remove. - */ - void - removeItem(Ptr::Ref id) throw (); - - - protected: - - /** - * The columns model needed by Gtk::TreeView. - * Lists one clip per row. - * - */ - class ModelColumns : public PlayableTreeModelColumnRecord - { - public: - - /** - * The column for the type of the entry in the list - */ - Gtk::TreeModelColumn > - typeColumn; - - /** - * The column for the creator of the audio clip or playlist. - */ - Gtk::TreeModelColumn creatorColumn; - - /** - * The column for the title of the audio clip or playlist. - */ - Gtk::TreeModelColumn titleColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(typeColumn); - add(creatorColumn); - add(titleColumn); - } - }; - - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * The tree model, as a GTK reference. - */ - Glib::RefPtr treeModel; - - /** - * The tree view, now only showing rows. - */ - ZebraTreeView * treeView; - - /** - * The cue player widget controlling the audio buttons. - */ - Ptr::Ref cuePlayer; - - /** - * The right-click context menu for audio clips, - * that comes up when right-clicking an entry in the entry list. - */ - Ptr::Ref audioClipContextMenu; - - /** - * The right-click context menu for playlists, - * that comes up when right-clicking an entry in the entry list. - */ - Ptr::Ref playlistContextMenu; - - /** - * Signal handler for the mouse clicked on one of the entries. - * This is used to pop up the right-click context menu. - * - * @param event the button event recieved - * @return true if the event has been handled (a popup displayed), - * false otherwise - */ - virtual bool - onEntryClicked(GdkEventButton * event) throw (); - - /** - * Signal handler for the user double-clicking, or pressing Enter - * on one of the entries. - * - * @param path the TreePath of the row clicked on (ignored). - * @param column the TreeViewColumn clicked on (ignored). - */ - void - onDoubleClick(const Gtk::TreeModel::Path & path, - const Gtk::TreeViewColumn * column) - throw (); - - /** - * Signal handler for a key pressed at one of the entries. - * The keys can be customized by the keyboardShortcutContainer - * element in the gLiveSupport configuration file. - * - * The actions handled are: moveItemUp, moveItemDown and removeItem. - * - * @param event the button event received - * @return true if the key press was fully handled, false if not - */ - bool - onKeyPressed(GdkEventKey * event) throw (); - - /** - * Signal handler for the "edit playlist" menu item selected from - * the entry context menu. For playlists only. - */ - virtual void - onEditPlaylist(void) throw (); - - /** - * Signal handler for the "schedule playlist" menu item selected - * from the entry context menu. For playlists only. - */ - virtual void - onSchedulePlaylist(void) throw (); - - /** - * Signal handler for the "export playlist" menu item selected from - * the entry context menu. For playlists only. - */ - virtual void - onExportPlaylist(void) throw (); - - /** - * Signal handler for the "add to playlist" menu item selected from - * the entry context menu. - */ - virtual void - onAddToPlaylist(void) throw (); - - /** - * Signal handler for the "add to live mode" menu item selected from - * the entry context menu. - */ - virtual void - onAddToLiveMode(void) throw (); - - /** - * Signal handler for the "upload to hub" menu item selected from - * the entry context menu. - */ - virtual void - onUploadToHub(void) throw (); - - /** - * Event handler for the Remove menu item selected from - * the entry conext menu. - */ - virtual void - onRemoveMenuOption(void) throw (); - - /** - * The tree view we want to implement d'n'd on. - */ - virtual Gtk::TreeView * - getTreeViewForDnd (void) throw () - { - return treeView; - } - - /** - * The name of the window for the d'n'd methods. - */ - virtual Glib::ustring - getWindowNameForDnd (void) throw (); - - /** - * Return the topmost selected row. - * Sets selectedPaths and selectedIter; does not increment it. - * - * @return the first selected playable item. - */ - virtual Ptr::Ref - getFirstSelectedPlayable (void) throw (); - - /** - * Used to iterate over the selected rows. - * Reset to the first row by onEntryClicked(). - * Returns a 0 pointer if nothing is selected or we have reached - * the end of the list of selected rows. - * - * @return the next selected playable item. - */ - virtual Ptr::Ref - getNextSelectedPlayable (void) throw (); - - /** - * Add an item to the d'n'd tree view at the given position. - * - * @param iter the iterator pointing to the row to be filled in. - * @param id the ID of the item to add. - */ - virtual void - addItem (Gtk::TreeIter iter, - Ptr::Ref id) throw (); - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - ScratchpadWindow(Gtk::ToggleButton * windowOpenerButton) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~ScratchpadWindow(void) throw () - { - } - - /** - * Add an item to the Scratchpad. - * If it was already in the Scratchpad, move it to the top. - * - * @param playable the Playable object to add. - */ - void - addItem(Ptr::Ref playable) throw (); - - /** - * Add an item to the Scratchpad. - * If it was already in the Scratchpad, move it to the top. - * - * @param id the id of the item to add. - */ - void - addItem(Ptr::Ref id) throw (); - - /** - * Return the contents of the Scratchpad. - * - * @return a space-separated list of the unique IDs, in base 10. - */ - Ptr::Ref - getContents(void) throw (); - - /** - * Restore the contents of the Scratchpad. - * The current contents are discarded, and replaced with the items - * listed in the 'contents' parameter. - * - * @param contents a space-separated list of unique IDs, in base 10. - */ - void - setContents(Ptr::Ref contents) throw (); - - /** - * Return the user preferences key. - * The contents of the window will be stored in the user preferences - * under this key. - * - * @return the user preference key. - */ - Ptr::Ref - getUserPreferencesKey(void) throw () - { - return userPreferencesKey; - } - - /** - * Update the cue player display to show a stopped state. - */ - void - showCuePlayerStopped(void) throw () - { - cuePlayer->onStop(); - } - - /** - * Hide the window. - * - * This overrides GuiWindow::hide(), and closes the Export Playlist - * and Schedule Playlist pop-up windows, if they are still open. - */ - virtual void - hide(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // ScratchpadWindow_h - diff --git a/src/products/gLiveSupport/src/SearchWindow.cxx b/src/products/gLiveSupport/src/SearchWindow.cxx deleted file mode 100644 index 2080b0c2b..000000000 --- a/src/products/gLiveSupport/src/SearchWindow.cxx +++ /dev/null @@ -1,1128 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Widgets/WidgetFactory.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" - -#include "SearchWindow.h" - - -using namespace Glib; -using namespace boost::posix_time; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "searchWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "SearchWindow.glade"; - -/*------------------------------------------------------------------------------ - * The number of items which can be shown in the search results. - *----------------------------------------------------------------------------*/ -const int searchResultsSize = 25; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -SearchWindow :: SearchWindow (Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton) -{ - glade->get_widget("searchInputNoteBook1", searchInput); - - Gtk::Label * simpleSearchTabLabel; - Gtk::Label * advancedSearchTabLabel; - Gtk::Label * browseTabLabel; - Gtk::Label * transportsTabLabel; - glade->get_widget("simpleSearchTabLabel1", simpleSearchTabLabel); - glade->get_widget("advancedSearchTabLabel1", advancedSearchTabLabel); - glade->get_widget("browseTabLabel1", browseTabLabel); - glade->get_widget("transportsTabLabel1", transportsTabLabel); - simpleSearchTabLabel->set_label(*getResourceUstring("simpleSearchTab")); - advancedSearchTabLabel->set_label(*getResourceUstring("advancedSearchTab")); - browseTabLabel->set_label(*getResourceUstring("browseTab")); - transportsTabLabel->set_label(*getResourceUstring("transportsTab")); - - constructSearchWhereBox(); - - constructSimpleSearchView(); - constructAdvancedSearchView(); - constructBrowseView(); - constructTransportsView(); - - constructSearchResultsView(); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -SearchWindow :: ~SearchWindow (void) throw () -{ -} - - -/*------------------------------------------------------------------------------ - * Construct the transport type selection box. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: constructSearchWhereBox(void) throw () -{ - Gtk::Label * searchWhereLabel; - glade->get_widget("searchWhereLabel1", searchWhereLabel); - searchWhereLabel->set_label(*getResourceUstring("searchWhereLabel")); - - glade->get_widget_derived("searchWhereEntry1", searchWhereEntry); - searchWhereEntry->append_text(*getResourceUstring("searchWhereLocal")); - searchWhereEntry->append_text(*getResourceUstring("searchWhereRemote")); - searchWhereEntry->set_active(0); - searchWhereEntry->signal_changed().connect(sigc::mem_fun(*this, - &SearchWindow::onSearchWhereChanged)); -} - - -/*------------------------------------------------------------------------------ - * Construct the simple search view. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: constructSimpleSearchView(void) throw () -{ - glade->get_widget("simpleSearchEntry1", simpleSearchEntry); - simpleSearchEntry->signal_activate().connect(sigc::mem_fun(*this, - &SearchWindow::onSimpleSearch)); - - Gtk::Button * simpleSearchButton; - glade->get_widget("simpleSearchButton1", simpleSearchButton); - simpleSearchButton->set_label(*getResourceUstring("searchButtonLabel")); - simpleSearchButton->signal_clicked().connect(sigc::mem_fun(*this, - &SearchWindow::onSimpleSearch)); -} - - -/*------------------------------------------------------------------------------ - * Construct the advanced search view. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: constructAdvancedSearchView(void) throw () -{ - advancedSearchEntry.reset(new AdvancedSearchEntry(this)); - advancedSearchEntry->connectCallback(sigc::mem_fun(*this, - &SearchWindow::onAdvancedSearch )); - - Gtk::Button * advancedSearchButton; - glade->get_widget("advancedSearchButton1", advancedSearchButton); - advancedSearchButton->set_label(*getResourceUstring("searchButtonLabel")); - advancedSearchButton->signal_clicked().connect(sigc::mem_fun(*this, - &SearchWindow::onAdvancedSearch)); -} - - -/*------------------------------------------------------------------------------ - * Construct the browse view. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: constructBrowseView(void) throw () -{ - browseEntry.reset(new BrowseEntry(this)); - browseEntry->signalChanged().connect(sigc::mem_fun(*this, - &SearchWindow::onBrowse)); -} - - -/*------------------------------------------------------------------------------ - * Construct the transports view. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: constructTransportsView(void) throw () -{ - transportList.reset(new TransportList(this)); -} - - -/*------------------------------------------------------------------------------ - * Construct the search results display. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: constructSearchResultsView(void) throw () -{ - localSearchResults = Gtk::ListStore::create(modelColumns); - remoteSearchResults = Gtk::ListStore::create(modelColumns); - - glade->get_widget_derived("searchResultsTreeView1", searchResultsTreeView); - searchResultsTreeView->get_selection()->set_mode(Gtk::SELECTION_MULTIPLE); - searchResultsTreeView->set_model(localSearchResults); - searchResultsTreeView->connectModelSignals(localSearchResults); - searchResultsTreeView->connectModelSignals(remoteSearchResults); - - searchResultsTreeView->appendColumn( - *getResourceUstring("typeColumnLabel"), - modelColumns.typeColumn, 20); - searchResultsTreeView->appendColumn( - *getResourceUstring("titleColumnLabel"), - modelColumns.titleColumn, 300); - searchResultsTreeView->appendColumn( - *getResourceUstring("creatorColumnLabel"), - modelColumns.creatorColumn, 200); - searchResultsTreeView->appendColumn( - *getResourceUstring("sourceColumnLabel"), - modelColumns.sourceColumn, 145); - searchResultsTreeView->appendCenteredColumn( - *getResourceUstring("lengthColumnLabel"), - modelColumns.lengthColumn, 55); - - searchResultsTreeView->signal_button_press_event().connect( - sigc::mem_fun(*this, - &SearchWindow::onEntryClicked), - false /* call this first */); - searchResultsTreeView->signal_row_activated().connect(sigc::mem_fun(*this, - &SearchWindow::onDoubleClick)); - setupDndCallbacks(DND_SOURCE); - - audioClipContextMenu = constructAudioClipContextMenu(); - playlistContextMenu = constructPlaylistContextMenu(); - remoteContextMenu = constructRemoteContextMenu(); - - glade->get_widget("searchResultsCountLabel1", searchResultsCountLabel); - glade->get_widget("backwardButton1", backwardButton); - glade->get_widget("forwardButton1", forwardButton); - backwardButton->signal_clicked().connect(sigc::mem_fun(*this, - &SearchWindow::onBackwardButtonClicked)); - forwardButton->signal_clicked().connect(sigc::mem_fun(*this, - &SearchWindow::onForwardButtonClicked)); - - updatePagingToolbar(); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the simple Search button getting clicked. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onSimpleSearch(void) throw () -{ - Glib::ustring value = simpleSearchEntry->get_text(); - - Ptr::Ref metadataTypes - = gLiveSupport->getMetadataTypeContainer(); - MetadataTypeContainer::Vector::const_iterator - it = metadataTypes->begin(); - - Ptr::Ref criteria(new SearchCriteria("all", "or")); - Ptr::Ref metadata; - - if (it != metadataTypes->end()) { - metadata = *it; - criteria->addCondition(*metadata->getDcName(), "partial", value); - } - - if (++it != metadataTypes->end()) { - metadata = *it; - criteria->addCondition(*metadata->getDcName(), "partial", value); - } - - if (++it != metadataTypes->end()) { - metadata = *it; - criteria->addCondition(*metadata->getDcName(), "partial", value); - } - - onInitialSearch(criteria); -} - - -/*------------------------------------------------------------------------------ - * Event handler for the advanced Search button getting clicked. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onAdvancedSearch(void) throw () -{ - onInitialSearch(advancedSearchEntry->getSearchCriteria()); -} - - -/*------------------------------------------------------------------------------ - * Event handler for changed selection in the Browse view. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onBrowse(void) throw () -{ - onInitialSearch(browseEntry->getSearchCriteria()); -} - - -/*------------------------------------------------------------------------------ - * Do the searching (first set of results). - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onInitialSearch(Ptr::Ref criteria) - throw () -{ - criteria->setOffset(0); - criteria->setLimit(getSearchResultsSize()); - onSearch(criteria); -} - - -/*------------------------------------------------------------------------------ - * Do the searching (after paging backward or forward). - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onContinuedSearch(int offset) - throw () -{ - Ptr::Ref criteria = getSearchCriteria(); - criteria->setOffset(offset); - onSearch(criteria); -} - - -/*------------------------------------------------------------------------------ - * Do the searching. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onSearch(Ptr::Ref criteria) - throw () -{ - if (searchIsLocal()) { - localSearch(criteria); - } else { - remoteSearchOpen(criteria); - } -} - - -/*------------------------------------------------------------------------------ - * Search in the local storage. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: localSearch(Ptr::Ref criteria) - throw () -{ - displayMessage("pleaseWaitMsg", localSearchResults); - gLiveSupport->runMainLoop(); - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr::Ref searchResults; - try { - localSearchResultsCount = storage->search(sessionId, criteria); - searchResults = storage->getLocalSearchResults(); - } catch (XmlRpcException &e) { - displayLocalSearchError(e); - return; - } - - localSearchCriteria = criteria; - - displaySearchResults(searchResults, localSearchResults); -} - - -/*------------------------------------------------------------------------------ - * Display the search results. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: displaySearchResults( - Ptr::Ref searchResults, - Glib::RefPtr treeModel) - throw () -{ - treeModel->clear(); - searchResultsTreeView->set_model(treeModel); - updatePagingToolbar(); - - Ptr::Ref widgetFactory = WidgetFactory::getInstance(); - - SearchResultsType::const_iterator it = searchResults->begin(); - - if (it == searchResults->end()) { - displayMessage("nothingFoundMsg", treeModel); - return; - } - - for ( ; it != searchResults->end(); ++it) { - Ptr::Ref playable = *it; - Gtk::TreeModel::Row row = *treeModel->append(); - - row[modelColumns.playableColumn] = playable; - - switch (playable->getType()) { - case Playable::AudioClipType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetConstants::audioClipIconImage); - break; - case Playable::PlaylistType: - row[modelColumns.typeColumn] = widgetFactory->getPixbuf( - WidgetConstants::playlistIconImage); - break; - default: - break; - } - - Ptr::Ref - title = playable->getTitle(); - row[modelColumns.titleColumn] - = title ? Glib::Markup::escape_text(*title) - : ""; - - Ptr::Ref - creator = playable->getMetadata("dc:creator"); - row[modelColumns.creatorColumn] - = creator ? Glib::Markup::escape_text(*creator) - : ""; - - Ptr::Ref - source = playable->getMetadata("dc:source"); - row[modelColumns.sourceColumn] - = source ? Glib::Markup::escape_text(*source) - : ""; - - Ptr::Ref length = playable->getPlaylength(); - row[modelColumns.lengthColumn] = length ? - *TimeConversion::timeDurationToHhMmSsString(length) : ""; - } -} - - -/*------------------------------------------------------------------------------ - * Search on the network hub (initiate the async operation). - *----------------------------------------------------------------------------*/ -void -SearchWindow :: remoteSearchOpen(Ptr::Ref criteria) - throw () -{ - displayMessage("pleaseWaitMsg", remoteSearchResults); - remoteSearchCriteria.reset(); - updatePagingToolbar(); - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - if (remoteSearchToken) { - try { - storage->cancelTransport(sessionId, remoteSearchToken); - } catch (XmlRpcException &e) { - displayRemoteSearchError(e); - return; - } - } - - try { - remoteSearchToken = storage->remoteSearchOpen(sessionId, criteria); - } catch (XmlRpcException &e) { - displayRemoteSearchError(e); - } - - remoteSearchCriteria = criteria; -} - - -/*------------------------------------------------------------------------------ - * Search on the network hub (finish the async operation). - *----------------------------------------------------------------------------*/ -void -SearchWindow :: remoteSearchClose(void) - throw () -{ - if (remoteSearchToken) { - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - AsyncState state; - Ptr::Ref errorMessage(new Glib::ustring()); - try { - state = storage->checkTransport(remoteSearchToken, errorMessage); - } catch (XmlRpcException &e) { - displayRemoteSearchError(e); - return; - } - - Ptr::Ref results; - - if (state == AsyncState::finishedState) { - try { - remoteSearchResultsCount = - storage->remoteSearchClose(remoteSearchToken); - } catch (XmlRpcException &e) { - displayRemoteSearchError(e); - return; - } - remoteSearchToken.reset(); - - try { - results = storage->getRemoteSearchResults(); - } catch (XmlRpcException &e) { - displayRemoteSearchError(e); - return; - } - - displaySearchResults(results, remoteSearchResults); - - } else if (state == AsyncState::closedState) { - remoteSearchToken.reset(); - displayMessage("shortErrorMsg", remoteSearchResults); - - } else if (state == AsyncState::failedState) { - remoteSearchToken.reset(); - gLiveSupport->displayMessageWindow(*formatMessage("longErrorMsg", - *errorMessage )); - displayMessage("shortErrorMsg", remoteSearchResults); - } - } -} - - -/*------------------------------------------------------------------------------ - * Display a (usually error) message in the search results tree view. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: displayMessage(const Glib::ustring & messageKey, - Glib::RefPtr treeModel) - throw () -{ - treeModel->clear(); - - Gtk::TreeModel::Row row = *treeModel->append(); - row[modelColumns.titleColumn] = *getResourceUstring(messageKey); - - searchResultsTreeView->set_model(treeModel); -} - - -/*------------------------------------------------------------------------------ - * Display an error message which occurred during a search. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: displayError(const XmlRpcException & error, - Glib::RefPtr treeModel) - throw () -{ - gLiveSupport->displayMessageWindow(*formatMessage("longErrorMsg", - error.what() )); - displayMessage("shortErrorMsg", treeModel); -} - - -/*------------------------------------------------------------------------------ - * Display an error message which occurred during a local search. - *----------------------------------------------------------------------------*/ -inline void -SearchWindow :: displayLocalSearchError(const XmlRpcException & error) - throw () -{ - displayError(error, localSearchResults); -} - - -/*------------------------------------------------------------------------------ - * Display an error message which occurred during a remote search. - *----------------------------------------------------------------------------*/ -inline void -SearchWindow :: displayRemoteSearchError(const XmlRpcException & error) - throw () -{ - displayError(error, remoteSearchResults); -} - - -/*------------------------------------------------------------------------------ - * Event handler for an entry being clicked in the list - *----------------------------------------------------------------------------*/ -bool -SearchWindow :: onEntryClicked (GdkEventButton * event) throw () -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - Ptr::Ref playable = getFirstSelectedPlayable(); - - if (selectedPaths->size() == 1) { - if (playable->getType() == Playable::AudioClipType) { - audioClipContextMenu->popup(event->button, event->time); - return true; - - } else if (playable->getType() == Playable::PlaylistType) { - playlistContextMenu->popup(event->button, event->time); - return true; - } - - } else if (selectedPaths->size() > 1) { - audioClipContextMenu->popup(event->button, event->time); - return true; - } - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Return the first selected playable item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SearchWindow :: getFirstSelectedPlayable(void) throw () -{ - Ptr::Ref playable; - - Glib::RefPtr - selection = searchResultsTreeView->get_selection(); - selectedPaths.reset(new std::vector( - selection->get_selected_rows())); - - if (selectedPaths->size() > 0) { - selectedIter = selectedPaths->begin(); - Glib::RefPtr - treeModel = searchResultsTreeView->get_model(); - Gtk::TreeRow row = *(treeModel->get_iter(*selectedIter)); - playable = row[modelColumns.playableColumn]; - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Return the next selected playable item. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SearchWindow :: getNextSelectedPlayable(void) throw () -{ - Ptr::Ref playable; - - if (selectedPaths) { - if (selectedIter != selectedPaths->end()) { - Glib::RefPtr - treeModel = searchResultsTreeView->get_model(); - Gtk::TreeRow row = *(treeModel->get_iter(*selectedIter)); - playable = row[modelColumns.playableColumn]; - ++selectedIter; - } else { - selectedPaths.reset(); - } - } - - return playable; -} - - -/*------------------------------------------------------------------------------ - * Add a playable to the scratchpad. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onAddToScratchpad(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - try { - gLiveSupport->addToScratchpad(playable); - } catch (XmlRpcException &e) { - Ptr::Ref errorMessage(new Glib::ustring( - "error in SearchWindow::onAddToScratchpad(): ")); - errorMessage->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMessage); - } - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the Add To Playlist menu item selected from the - * entry context menu - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onAddToPlaylist(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - try { - gLiveSupport->addToPlaylist(playable->getId()); - } catch (XmlRpcException &e) { - Ptr::Ref errorMessage(new Glib::ustring( - "error in SearchWindow::onAddToPlaylist(): ")); - errorMessage->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMessage); - } - } -} - - -/*------------------------------------------------------------------------------ - * Add a playable to the live mode. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onAddToLiveMode(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - try { - gLiveSupport->addToScratchpad(playable); - playable = gLiveSupport->getPlayable(playable->getId()); - gLiveSupport->addToLiveMode(playable); - } catch (XmlRpcException &e) { - Ptr::Ref errorMessage(new Glib::ustring( - "error in SearchWindow::onAddToLiveMode(): ")); - errorMessage->append(e.what()); - gLiveSupport->displayMessageWindow(*errorMessage); - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Edit Playlist menu item selected from the - * entry context menu. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onEditPlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - try { - gLiveSupport->openPlaylistForEditing(playlist->getId()); - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(*getResourceUstring( - "cannotEditPlaylistMsg" )); - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for the Schedule Playlist menu item selected from the - * entry context menu. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onSchedulePlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - schedulePlaylistWindow.reset(new SchedulePlaylistWindow(playlist)); - schedulePlaylistWindow->getWindow()->set_transient_for(*mainWindow); - Gtk::Main::run(*schedulePlaylistWindow->getWindow()); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "export playlist" in the context menu. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onExportPlaylist(void) throw () -{ - Ptr::Ref playable = getNextSelectedPlayable(); - Ptr::Ref playlist = playable->getPlaylist(); - - if (playlist) { - exportPlaylistWindow.reset(new ExportPlaylistWindow(playlist)); - exportPlaylistWindow->getWindow()->set_transient_for(*mainWindow); - Gtk::Main::run(*exportPlaylistWindow->getWindow()); - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "upload to hub" in the context menu. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onUploadToHub(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - uploadToHub(playable); - } -} - - -/*------------------------------------------------------------------------------ - * Add the Playable object to the list of pending "upload to hub" - * tasks displayed in the Transports tab. - *----------------------------------------------------------------------------*/ -bool -SearchWindow :: uploadToHub(Ptr::Ref playable) throw () -{ - try { - searchInput->set_current_page(3); - transportList->addUpload(playable); - - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(*formatMessage("uploadToHubErrorMsg", - e.what() )); - return false; - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * Signal handler for "download from hub" in the context menu. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onDownloadFromHub(void) throw () -{ - Ptr::Ref playable; - - while ((playable = getNextSelectedPlayable())) { - if (!gLiveSupport->existsPlayable(playable->getId())) { - try { - searchInput->set_current_page(3); - transportList->addDownload(playable); - - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(*formatMessage( - "downloadFromHubErrorMsg", e.what() )); - return; - } - } else { - onAddToScratchpad(); - } - } -} - - -/*------------------------------------------------------------------------------ - * Signal handler for the user double-clicking or pressing Enter. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onDoubleClick(const Gtk::TreeModel::Path & path, - const Gtk::TreeViewColumn * column) - throw () -{ - Ptr::Ref playable = getFirstSelectedPlayable(); - - if (playable) { - if (searchIsLocal()) { - onAddToScratchpad(); - } else { - onDownloadFromHub(); - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler called when the the window gets hidden. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: hide(void) throw () -{ - if (exportPlaylistWindow) { - exportPlaylistWindow->getWindow()->hide(); - } - if (schedulePlaylistWindow) { - schedulePlaylistWindow->getWindow()->hide(); - } - - GuiWindow::hide(); -} - - -/*------------------------------------------------------------------------------ - * Check the status of the "search where" input box. - *----------------------------------------------------------------------------*/ -bool -SearchWindow :: searchIsLocal(void) throw () -{ - int searchWhere = searchWhereEntry->get_active_row_number(); - - switch (searchWhere) { - case 0: return true; - break; - - case 1: return false; - break; - - default: - std::cerr << "impossible value in SearchWindow::searchIsLocal()" - << std::endl; - std::exit(1); - break; - } -} - - -/*------------------------------------------------------------------------------ - * Change the displayed search results (local or remote). - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onSearchWhereChanged(void) throw () -{ - if (searchIsLocal()) { - searchInput->get_nth_page(2)->set_sensitive(true); - searchResultsTreeView->set_model(localSearchResults); - } else { - if (searchInput->get_current_page() == 2) { - searchInput->set_current_page(0); - } - searchInput->get_nth_page(2)->set_sensitive(false); - searchResultsTreeView->set_model(remoteSearchResults); - } - - updatePagingToolbar(); -} - - -/*------------------------------------------------------------------------------ - * Perform the periodic checks on the asynchronous methods. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onTimer(void) throw () -{ - remoteSearchClose(); - transportList->updateSilently(); -} - - -/*------------------------------------------------------------------------------ - * Construct the right-click context menu for local audio clips. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SearchWindow :: constructAudioClipContextMenu(void) throw () -{ - Ptr::Ref contextMenu(new Gtk::Menu()); - Gtk::Menu::MenuList & contextMenuList = contextMenu->items(); - - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToLiveModeMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onAddToLiveMode))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToPlaylistMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onAddToPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToScratchpadMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onAddToScratchpad))); - contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem()); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("uploadToHubMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onUploadToHub))); - - contextMenu->accelerate(*mainWindow); - return contextMenu; -} - - -/*------------------------------------------------------------------------------ - * Construct the right-click context menu for local playlists. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SearchWindow :: constructPlaylistContextMenu(void) throw () -{ - Ptr::Ref contextMenu(new Gtk::Menu()); - Gtk::Menu::MenuList & contextMenuList = contextMenu->items(); - - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToLiveModeMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onAddToLiveMode))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToPlaylistMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onAddToPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("addToScratchpadMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onAddToScratchpad))); - contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem()); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("editPlaylistMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onEditPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("schedulePlaylistMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onSchedulePlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("exportPlaylistMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onExportPlaylist))); - contextMenuList.push_back(Gtk::Menu_Helpers::SeparatorElem()); - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("uploadToHubMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onUploadToHub))); - - contextMenu->accelerate(*mainWindow); - return contextMenu; -} - - -/*------------------------------------------------------------------------------ - * Construct the right-click context menu for remote audio clips & playlists. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SearchWindow :: constructRemoteContextMenu(void) throw () -{ - Ptr::Ref contextMenu(new Gtk::Menu()); - Gtk::Menu::MenuList & contextMenuList = contextMenu->items(); - - contextMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("downloadFromHubMenuItem"), - sigc::mem_fun(*this, - &SearchWindow::onDownloadFromHub))); - - contextMenu->accelerate(*mainWindow); - return contextMenu; -} - - -/*------------------------------------------------------------------------------ - * Return the number of search results which can be displayed. - *----------------------------------------------------------------------------*/ -int -SearchWindow :: getSearchResultsSize(void) throw () -{ - return searchResultsSize; -} - - -/*------------------------------------------------------------------------------ - * Event handler for a click on the Backward button. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onBackwardButtonClicked(void) throw () -{ - Ptr::Ref criteria = getSearchCriteria(); - int offset = criteria->getOffset(); - - if (offset > 0) { - int newOffset = offset - getSearchResultsSize(); - if (newOffset < 0) { - newOffset = 0; - } - onContinuedSearch(newOffset); - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for a click on the Forward button. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: onForwardButtonClicked(void) throw () -{ - Ptr::Ref criteria = getSearchCriteria(); - int offset = criteria->getOffset(); - int count = getSearchResultsCount(); - - int newOffset = offset + getSearchResultsSize(); - if (newOffset < count) { - onContinuedSearch(newOffset); - } -} - - -/*------------------------------------------------------------------------------ - * Enable or disable the Backward and Forward buttons. - *----------------------------------------------------------------------------*/ -void -SearchWindow :: updatePagingToolbar(void) throw () -{ - Ptr::Ref criteria = getSearchCriteria(); - - if (criteria) { - int offset = criteria->getOffset(); - int count = getSearchResultsCount(); - int lastNumber = std::min(offset + getSearchResultsSize(), count); - - try { - if (count > 0) { - searchResultsCountLabel->set_text(*formatMessage( - "searchResultsCountLabel", - itoa(offset + 1), - itoa(lastNumber), - itoa(count) )); - } else { - searchResultsCountLabel->set_text(""); - } - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - std::exit(1); - } - backwardButton->set_sensitive(offset != 0); - forwardButton->set_sensitive(offset + getSearchResultsSize() < count); - } else { - searchResultsCountLabel->set_text(""); - backwardButton->set_sensitive(false); - forwardButton->set_sensitive(false); - } -} - - -/*------------------------------------------------------------------------------ - * The name of the window for the d'n'd methods. - *----------------------------------------------------------------------------*/ -Glib::ustring -SearchWindow :: getWindowNameForDnd (void) throw () -{ - return bundleName; -} - - diff --git a/src/products/gLiveSupport/src/SearchWindow.h b/src/products/gLiveSupport/src/SearchWindow.h deleted file mode 100644 index c88785876..000000000 --- a/src/products/gLiveSupport/src/SearchWindow.h +++ /dev/null @@ -1,697 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SearchWindow_h -#define SearchWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "GuiWindow.h" -#include "DndMethods.h" -#include "LiveSupport/Core/NumericTools.h" - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/LocalizedObject.h" -#include "LiveSupport/Widgets/PlayableTreeModelColumnRecord.h" -#include "AdvancedSearchEntry.h" -#include "BrowseEntry.h" -#include "GLiveSupport.h" -#include "SchedulePlaylistWindow.h" -#include "ExportPlaylistWindow.h" -#include "TransportList.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The Search/Browse window. - * - */ -class SearchWindow : public GuiWindow, - public DndMethods, - private NumericTools -{ - private: - - /** - * The criteria for the last local search. - */ - Ptr::Ref localSearchCriteria; - - /** - * The criteria for the last remote search. - */ - Ptr::Ref remoteSearchCriteria; - - /** - * The number of items found by the last local search. - */ - int localSearchResultsCount; - - /** - * The number of items found by the last remote search. - */ - int remoteSearchResultsCount; - - /** - * The list of selected rows, as path references (row numbers). - * Reset by onEntryClicked(). - */ - Ptr >::Ref selectedPaths; - /** - * One of the selected rows, set to the first one by onEntryClicked(). - * Incremented by getNextSelectedPlayable(). - */ - std::vector::const_iterator selectedIter; - - /** - * The "search where" input field. - */ - ComboBoxText * searchWhereEntry; - - /** - * The simple search input field. - */ - Gtk::Entry * simpleSearchEntry; - - /** - * The box containing the advanced search input fields. - */ - Ptr::Ref advancedSearchEntry; - - /** - * The box containing the browse input fields. - */ - Ptr::Ref browseEntry; - - /** - * The list of transports in progress. - */ - Ptr::Ref transportList; - - /** - * The button for paging in the search results backward. - */ - Gtk::Button * backwardButton; - - /** - * The button for paging in the search results forward. - */ - Gtk::Button * forwardButton; - - /** - * The Schedule Playlist pop-up window. - */ - Ptr::Ref schedulePlaylistWindow; - - /** - * The Export Playlist pop-up window. - */ - Ptr::Ref exportPlaylistWindow; - - /** - * The tree model, as a GTK reference, for the local search results. - */ - Glib::RefPtr localSearchResults; - - /** - * The tree model, as a GTK reference, for the remote search results. - */ - Glib::RefPtr remoteSearchResults; - - /** - * The tree view showing the search results. - */ - ZebraTreeView * searchResultsTreeView; - - /** - * The label showing the number of search results. - */ - Gtk::Label * searchResultsCountLabel; - - /** - * The notebook for the various tabs in the window. - */ - Gtk::Notebook * searchInput; - - /** - * The transport token used when a remote search is pending. - */ - Ptr::Ref remoteSearchToken; - - /** - * The pop-up context menu for local audio clips. - */ - Ptr::Ref audioClipContextMenu; - - /** - * The pop-up context menu for local playlists. - */ - Ptr::Ref playlistContextMenu; - - /** - * The pop-up context menu for remote audio clips and playlists. - */ - Ptr::Ref remoteContextMenu; - - /** - * Construct the "search where" box. - * This contains a combo box, where the user can choose between - * local search or hub search. - */ - void - constructSearchWhereBox(void) throw (); - - /** - * Construct the simple search view. - * If you enter a string in theGtk::VBox simple search view and - * press Enter - * (or the Search button), the local storage will be searched for - * items (both audio clips and playlists) where either the title - * (dc:title), the creator (dc:creator) or the album (dc:source) - * metadata fields contain this string. - */ - void - constructSimpleSearchView(void) throw (); - - /** - * Construct the advanced search view. - */ - void - constructAdvancedSearchView(void) throw (); - - /** - * Construct the browse view. - */ - void - constructBrowseView(void) throw (); - - /** - * Construct the advanced search view. - */ - void - constructTransportsView(void) throw (); - - /** - * Construct the search results display. - */ - void - constructSearchResultsView(void) throw (); - - /** - * Construct the right-click context menu for local audio clips. - * - * @return the context menu created. - */ - Ptr::Ref - constructAudioClipContextMenu(void) throw (); - - /** - * Construct the right-click context menu for local playlists. - * - * @return the context menu created. - */ - Ptr::Ref - constructPlaylistContextMenu(void) throw (); - - /** - * Construct the right-click context menu for remote audio clips - * and playlists. - * - * @return the context menu created. - */ - Ptr::Ref - constructRemoteContextMenu(void) throw (); - - /** - * Check the status of the "search where" input box. - */ - bool - searchIsLocal(void) throw (); - - /** - * Get the search criteria used for the last search - * of the currently selected kind. - * Returns either localSearchCriteria or remoteSearchCriteria - * depending on the value of searchIsLocal(). - * - * @return the saved search criteria of the appropriate kind; - * or a 0 pointer if nothing has been saved yet. - */ - Ptr::Ref - getSearchCriteria(void) throw () - { - return searchIsLocal() ? localSearchCriteria - : remoteSearchCriteria; - } - - /** - * Get the number of search results found by the last search - * of the currently selected kind. - * Returns either localSearchResultsCount or remoteSearchResultsCount - * depending on the value of searchIsLocal(). - * - * @return the saved search result count of the appropriate kind; - * undefined if nothing has been saved yet. - */ - int - getSearchResultsCount(void) throw () - { - return searchIsLocal() ? localSearchResultsCount - : remoteSearchResultsCount; - } - - /** - * Change the displayed search results (local or remote). - */ - void - onSearchWhereChanged(void) throw (); - - /** - * Search in the local storage. - * - * @param criteria the search criteria. - */ - void - localSearch(Ptr::Ref criteria) throw (); - - /** - * Search on the network hub (initiate the async operation). - * - * @param criteria the search criteria. - */ - void - remoteSearchOpen(Ptr::Ref criteria) throw (); - - /** - * Search on the network hub (finish the async operation). - */ - void - remoteSearchClose(void) throw (); - - /** - * Typedef to save some typing. - */ - typedef StorageClientInterface::SearchResultsType - SearchResultsType; - - /** - * Display the search results. - * The most important metadata are shown in the rows of the given - * tree model. - */ - void - displaySearchResults( - Ptr::Ref searchResults, - Glib::RefPtr treeModel) - throw (); - - /** - * Update the paging portion of the search results view. - * Prints the number of results, and enables or disables - * the Backward and Forward buttons. - */ - void - updatePagingToolbar(void) throw (); - - /** - * Display a (usually error) message in the search results tree view. - * - * @param messageKey the localization key for the message. - * @param treeModel the tree model to display the message in. - */ - void - displayMessage(const Glib::ustring & messageKey, - Glib::RefPtr treeModel) - throw (); - - /** - * Display an error message which occurred during a search. - * - * @param error the error which occurred. - * @param treeModel the tree model to display the message in. - */ - void - displayError(const XmlRpcException & error, - Glib::RefPtr treeModel) - throw (); - - /** - * Display an error message which occurred during a local search. - * - * @param error the error which occurred. - */ - void - displayLocalSearchError(const XmlRpcException & error) - throw (); - - /** - * Display an error message which occurred during a remote search. - * - * @param error the error which occurred. - */ - void - displayRemoteSearchError(const XmlRpcException & error) - throw (); - - - protected: - - /** - * The columns model needed by Gtk::TreeView. - * Lists one clip per row. - * - */ - class ModelColumns : public PlayableTreeModelColumnRecord - { - public: - /** - * The column for the type of the entry in the list - */ - Gtk::TreeModelColumn > - typeColumn; - - /** - * The column for the title of the audio clip or playlist. - */ - Gtk::TreeModelColumn titleColumn; - - /** - * The column for the creator of the audio clip or playlist. - */ - Gtk::TreeModelColumn creatorColumn; - - /** - * The column for the album of the audio clip or playlist. - */ - Gtk::TreeModelColumn sourceColumn; - - /** - * The column for the length of the audio clip or playlist. - */ - Gtk::TreeModelColumn lengthColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(typeColumn); - add(titleColumn); - add(creatorColumn); - add(sourceColumn); - add(lengthColumn); - } - }; - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * Return the number of search results which can be displayed. - * As currently implemented, this returns a constant 10. - * - * @return the number of rows which can be displayed in the - * search results section of the window. - */ - int - getSearchResultsSize(void) throw (); - - /** - * Event handler for the simple Search button getting clicked. - */ - void - onSimpleSearch(void) throw (); - - /** - * Event handler for the advanced Search button getting clicked. - */ - void - onAdvancedSearch(void) throw (); - - /** - * Event handler for changed selection in the Browse view. - */ - void - onBrowse(void) throw (); - - /** - * Do the searching (first set of results). - * Sets the offset to 0, and calls onSearch(). - * - * @param criteria the search criteria. - */ - void - onInitialSearch(Ptr::Ref criteria) throw (); - - /** - * Do the searching (after paging backward or forward). - * Sets the offset to the given value, and calls onSearch(). - * - * @param offset the new offset to use for this search. - */ - void - onContinuedSearch(int offset) throw (); - - /** - * Do the searching. - * Calls either localSearch() or remoteSearch(). - * - * @param criteria the search criteria. - */ - void - onSearch(Ptr::Ref criteria) throw (); - - /** - * Signal handler for the mouse clicked on one of the entries. - * - * @param event the button event received - * @return true if the event has been handled (a popup displayed), - * false otherwise - */ - bool - onEntryClicked(GdkEventButton * event) throw (); - - /** - * Signal handler for the user double-clicking, or pressing Enter - * on one of the entries. - * - * @param path the TreePath of the row clicked on (ignored). - * @param column the TreeViewColumn clicked on (ignored). - */ - void - onDoubleClick(const Gtk::TreeModel::Path & path, - const Gtk::TreeViewColumn * column) - throw (); - - /** - * Add a playable to the scratchpad. - */ - void - onAddToScratchpad(void) throw (); - - /** - * Signal handler for the "add to playlist" menu item selected from - * the entry context menu. - */ - void - onAddToPlaylist(void) throw (); - - /** - * Add a playable to the live mode. - */ - void - onAddToLiveMode(void) throw (); - - /** - * Signal handler for the "edit playlist" menu item selected from - * the entry context menu. - */ - void - onEditPlaylist(void) throw (); - - /** - * Signal handler for the "schedule playlist" menu item selected - * from the entry context menu. - */ - void - onSchedulePlaylist(void) throw (); - - /** - * Signal handler for the "export playlist" menu item selected from - * the entry context menu. - */ - void - onExportPlaylist(void) throw (); - - /** - * Signal handler for "upload to hub" in the context menu. - */ - void - onUploadToHub(void) throw (); - - /** - * Signal handler for "download from hub" in the context menu. - */ - void - onDownloadFromHub(void) throw (); - - /** - * Event handler for a click on the Backward button. - */ - void - onBackwardButtonClicked(void) throw (); - - /** - * Event handler for a click on the Forward button. - */ - void - onForwardButtonClicked(void) throw (); - - /** - * The tree view we want to implement d'n'd on. - */ - virtual Gtk::TreeView * - getTreeViewForDnd (void) throw () - { - return searchResultsTreeView; - } - - /** - * The name of the window for the d'n'd methods. - */ - virtual Glib::ustring - getWindowNameForDnd (void) throw (); - - /** - * Return the topmost selected row. - * Sets selectedPaths and selectedIter; does not increment it. - * - * @return the first selected playable item. - */ - virtual Ptr::Ref - getFirstSelectedPlayable(void) throw (); - - /** - * Used to iterate over the selected rows. - * Reset to the first row by onEntryClicked(). - * Returns a 0 pointer if nothing is selected or we have reached - * the end of the list of selected rows. - * - * @return the next selected playable item. - */ - virtual Ptr::Ref - getNextSelectedPlayable(void) throw (); - - /** - * Add an item to the tree view at the given position. - * Required to implement by DndMethods, does not do anything here. - * - * @param iter the iterator pointing to the row to be filled in. - * @param id the ID of the item to add. - */ - virtual void - addItem(Gtk::TreeIter iter, - Ptr::Ref id) throw () - { - } - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - SearchWindow(Gtk::ToggleButton * windowOpenerButton) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~SearchWindow(void) throw (); - - /** - * Perform the periodic checks on the asynchronous methods. - * This is called every few seconds by the onUpdateTime() function - * in the MasterPanelWindow. - */ - void - onTimer(void) throw (); - - /** - * Add the Playable object to the list of pending "upload to hub" - * tasks displayed in the Transports tab. - * - * @param playable the object to be uploaded to the hub. - * @return true on success. - */ - bool - uploadToHub(Ptr::Ref playable) throw (); - - /** - * Hide the window. - * - * This overrides GuiWindow::hide(), and closes the Export Playlist - * and Schedule Playlist windows, if they are still open. - */ - virtual void - hide(void) throw (); -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // SearchWindow_h - diff --git a/src/products/gLiveSupport/src/TaskbarIcons.cxx b/src/products/gLiveSupport/src/TaskbarIcons.cxx deleted file mode 100644 index 675545dc8..000000000 --- a/src/products/gLiveSupport/src/TaskbarIcons.cxx +++ /dev/null @@ -1,106 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "TaskbarIcons.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * The name of the config element for this class - */ -const std::string TaskbarIcons::configElementName = "taskbarIcons"; - -namespace { - -/** - * The name of the icon sub-element. - */ -const std::string iconElementName = "icon"; - -/** - * The name of the path attribute. - */ -const std::string pathAttributeName = "path"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Create a taskbar icons object based on an XML element. - *----------------------------------------------------------------------------*/ -void -TaskbarIcons :: configure(const xmlpp::Element & element) - throw (std::invalid_argument) -{ - if (element.get_name() != configElementName) { - throw std::invalid_argument("bad coniguration element " - + element.get_name()); - } - - xmlpp::Node::NodeList childNodes = element.get_children(iconElementName); - xmlpp::Node::NodeList::const_iterator it; - - for (it = childNodes.begin(); it != childNodes.end(); ++it) { - const xmlpp::Element * iconElement - = dynamic_cast (*it); - xmlpp::Attribute * pathAttr = iconElement->get_attribute( - pathAttributeName ); - if (pathAttr) { - Glib::ustring path = pathAttr->get_value(); - try { - Glib::RefPtr - image = Gdk::Pixbuf::create_from_file(path); - taskbarIconList.push_back(image); - - } catch (Glib::FileError &e) { - Glib::ustring errorMsg = "could not open icon image file: "; - errorMsg += e.what(); - throw std::invalid_argument(errorMsg); - } catch (Gdk::PixbufError &e) { - Glib::ustring errorMsg = "could not create icon image: "; - errorMsg += e.what(); - throw std::invalid_argument(errorMsg); - } - } else { - throw std::invalid_argument("missing path attribute in " - "taskbarIcons/icon"); - } - } -} diff --git a/src/products/gLiveSupport/src/TaskbarIcons.h b/src/products/gLiveSupport/src/TaskbarIcons.h deleted file mode 100644 index be40f03d7..000000000 --- a/src/products/gLiveSupport/src/TaskbarIcons.h +++ /dev/null @@ -1,163 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef TaskbarIcons_h -#define TaskbarIcons_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Container holding taskbar icon images. - * - * This object has to be configured with an XML configuration element - * called taskbarIcons. This may look like the following: - * - *

- *  <taskbarIcons>
- *      <icon path="..." />
- *      <icon path="..." />
- *      ...
- *      <icon path="..." />
- *  </taskbarIcons>
- *  
- * - * The DTD for the expected XML element is the following: - * - *

- *  
- *  
- *  
- *  
- * - * @see TaskbarIcon - */ -class TaskbarIcons : public Configurable -{ - private: - /** - * The name of the configuration XML element used by TaskbarIcons. - */ - static const std::string configElementName; - - /** - * A vector type holding the taskbar icon images. - */ - typedef std::vector > - PixbufListType; - - /** - * The list of all taskbar icon images. - */ - PixbufListType taskbarIconList; - - - public: - /** - * Constructor. - */ - TaskbarIcons() throw () - { - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~TaskbarIcons(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementName; - } - - /** - * Configure the metadata object based on an XML configuration element. - * - * @param elemen the XML configuration element. - * @exception std::invalid_argument of the supplied XML element - * contains bad configuration information - */ - virtual void - configure(const xmlpp::Element &element) - throw (std::invalid_argument); - - /** - * Return a Glib::ListHandle to the list of taskbar icon images. - */ - const Glib::ListHandle > - getIconList(void) const throw () - { - return taskbarIconList; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // TaskbarIcons_h - diff --git a/src/products/gLiveSupport/src/TestRunner.cxx b/src/products/gLiveSupport/src/TestRunner.cxx deleted file mode 100644 index 6b3abb0b9..000000000 --- a/src/products/gLiveSupport/src/TestRunner.cxx +++ /dev/null @@ -1,279 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -using namespace LiveSupport::Core; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/** - * Our copyright notice, should be at most 80 columns - */ -const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -const char options[] = "ho:s:v"; - -/** - * Structure describing the long options - */ -const struct option longOptions[] = - { - { "help", no_argument, 0, 'h' }, - { "output", required_argument, 0, 'o' }, - { "stylesheet", required_argument, 0, 's' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } - }; - -/** - * The encoding to use for the output file. - */ -const std::string encoding = "utf-8"; - -/** - * The output XML file name. - */ -Ptr::Ref xmlOutFileName; - -/** - * The XSLT attached to the output file. - */ -Ptr::Ref xsltFileName; - -} - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -void -printUsage ( const char invocation[], - std::ostream & os ); - -/** - * Process command line arguments. - * - * @param argc the number of arguments. - * @param argv the arguments themselves. - * @return true of all went well, false in case the program should exit - * after this call. - */ -bool -processArguments(int argc, char *argv[]); - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Run all tests - *----------------------------------------------------------------------------*/ -int -main( int argc, - char * argv[] ) throw () -{ - if (!processArguments(argc, argv)) { - return 0; - } - - // Create the event manager and test controller - CPPUNIT_NS::TestResult controller; - - // Add a listener that colllects test result - CPPUNIT_NS::TestResultCollector result; - controller.addListener( &result ); - - // Add a listener that print dots as test run. - CPPUNIT_NS::BriefTestProgressListener progress; - controller.addListener( &progress ); - - // Add the top suite to the test runner - CPPUNIT_NS::TestRunner runner; - runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); - runner.run( controller ); - - // Print test in a compiler compatible format. - CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr ); - outputter.setLocationFormat("%p:%l:"); - outputter.write(); - - // also generate an XML document as an output - std::ofstream xmlOutFile(xmlOutFileName->c_str()); - CPPUNIT_NS::XmlOutputter xmlOutputter(&result, xmlOutFile, encoding); - xmlOutputter.setStandalone(false); - if (xsltFileName) { - xmlOutputter.setStyleSheet(*xsltFileName); - } - xmlOutputter.write(); - xmlOutFile.flush(); - xmlOutFile.close(); - - return result.wasSuccessful() ? 0 : 1; -} - - -/*------------------------------------------------------------------------------ - * Process command line arguments. - *----------------------------------------------------------------------------*/ -bool -processArguments(int argc, char *argv[]) -{ - int i; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'h': - printUsage(argv[0], std::cout); - return false; - - case 'o': - xmlOutFileName.reset(new std::string(optarg)); - break; - - case 's': - xsltFileName.reset(new std::string(optarg)); - break; - - case 'v': - printVersion(std::cout); - return false; - - default: - printUsage(argv[0], std::cout); - return false; - } - } - - if (optind < argc) { - std::cerr << "error processing command line arguments" << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - if (!xmlOutFileName) { - std::cerr << "mandatory option output file name not specified" - << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - std::cerr << "writing output to '" << *xmlOutFileName << '\'' << std::endl; - if (xsltFileName) { - std::cerr << "using XSLT file '" << *xsltFileName << '\'' << std::endl; - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION]" - << std::endl - << " mandatory options:" << std::endl - << " -o, --output=file.name write test results into this XML file" - << std::endl - << " optional options:" << std::endl - << " -s, --stylesheet specify this XSLT for the output file" - << std::endl - << " this is either an absolute URI, or a" - << std::endl - << " relative path for the output document" - << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/products/gLiveSupport/src/TransportList.cxx b/src/products/gLiveSupport/src/TransportList.cxx deleted file mode 100644 index b3d73ce1d..000000000 --- a/src/products/gLiveSupport/src/TransportList.cxx +++ /dev/null @@ -1,494 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/TimeConversion.h" -#include "TransportList.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "transportList"; - -/*------------------------------------------------------------------------------ - * The localization key for the 'working' status. - *----------------------------------------------------------------------------*/ -const Glib::ustring workingStatusKey = "workingStatus"; - -/*------------------------------------------------------------------------------ - * The localization key for the 'success' status. - *----------------------------------------------------------------------------*/ -const Glib::ustring successStatusKey = "successStatus"; - -/*------------------------------------------------------------------------------ - * The localization key for the 'fault' status. - *----------------------------------------------------------------------------*/ -const Glib::ustring faultStatusKey = "faultStatus"; - -/*------------------------------------------------------------------------------ - * The name of the user preference for storing the list of transports. - *----------------------------------------------------------------------------*/ -const Glib::ustring userPreferencesKeyName = "activeTransports"; - -/*------------------------------------------------------------------------------ - * The symbol for an upload. - *----------------------------------------------------------------------------*/ -const Glib::ustring uploadSymbol = "⇧"; - -/*------------------------------------------------------------------------------ - * The symbol for a download. - *----------------------------------------------------------------------------*/ -const Glib::ustring downloadSymbol = "⇩"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -TransportList :: TransportList(GuiObject * parent) - throw () - : GuiComponent(parent, - bundleName) -{ - // create the tree view - treeModel = Gtk::ListStore::create(modelColumns); - glade->get_widget_derived("transportsTreeView1", treeView); - treeView->set_model(treeModel); - treeView->connectModelSignals(treeModel); - - // Add the TreeView's view columns: - treeView->appendColumn("", - modelColumns.directionColumn, 20); - treeView->appendColumn(*getResourceUstring("titleColumnLabel"), - modelColumns.titleColumn, 300); - treeView->appendColumn(*getResourceUstring("dateColumnLabel"), - modelColumns.dateColumn, 180); - treeView->appendColumn(*getResourceUstring("statusColumnLabel"), - modelColumns.statusDisplayColumn, 50); - - // register the signal handler for treeview entries being clicked - treeView->signal_button_press_event().connect_notify(sigc::mem_fun(*this, - &TransportList::onEntryClicked)); - - // create the right-click entry context menu - uploadMenu.reset(new Gtk::Menu()); - downloadMenu.reset(new Gtk::Menu()); - Gtk::Menu::MenuList& uploadMenuList = uploadMenu->items(); - Gtk::Menu::MenuList& downloadMenuList = downloadMenu->items(); - - uploadMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("cancelUploadMenuItem"), - sigc::mem_fun(*this, - &TransportList::onCancelTransport))); - downloadMenuList.push_back(Gtk::Menu_Helpers::MenuElem( - *getResourceUstring("cancelDownloadMenuItem"), - sigc::mem_fun(*this, - &TransportList::onCancelTransport))); - - Gtk::Window * mainWindow; - glade->get_widget("mainWindow1", mainWindow); - uploadMenu->accelerate(*mainWindow); - downloadMenu->accelerate(*mainWindow); - - userPreferencesKey.reset(new const Glib::ustring(userPreferencesKeyName)); -} - - -/*------------------------------------------------------------------------------ - * Add a new upload task to the list. - *----------------------------------------------------------------------------*/ -void -TransportList :: addUpload(Ptr::Ref playable) - throw (XmlRpcException) -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr::Ref token = storage->uploadToHub(sessionId, - playable->getId()); - - Gtk::TreeRow row = *treeModel->append(); - row[modelColumns.directionColumn] = uploadSymbol; - row[modelColumns.titleColumn] = *playable->getTitle(); - row[modelColumns.dateColumn] = *TimeConversion::nowString(); - row[modelColumns.statusColumn] = workingStatusKey; - row[modelColumns.statusDisplayColumn] - = *getResourceUstring(workingStatusKey); - row[modelColumns.tokenColumn] = token; -} - - -/*------------------------------------------------------------------------------ - * Add a new download task to the list. - *----------------------------------------------------------------------------*/ -void -TransportList :: addDownload(Ptr::Ref playable) - throw (XmlRpcException) -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr::Ref token = storage->downloadFromHub( - sessionId, - playable->getId()); - - Gtk::TreeRow row = *treeModel->append(); - row[modelColumns.directionColumn] = downloadSymbol; - row[modelColumns.titleColumn] = *playable->getTitle(); - row[modelColumns.dateColumn] = *TimeConversion::nowString(); - row[modelColumns.statusColumn] = workingStatusKey; - row[modelColumns.statusDisplayColumn] - = *getResourceUstring(workingStatusKey); - row[modelColumns.tokenColumn] = token; -} - - -/*------------------------------------------------------------------------------ - * Add an item with an already existing token to the list. - *----------------------------------------------------------------------------*/ -void -TransportList :: add(const Glib::ustring & title, - const Glib::ustring & date, - const Glib::ustring & token, - bool isUpload) - throw (XmlRpcException) -{ - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - Ptr::Ref tokenPtr(new Glib::ustring(token)); - Ptr::Ref errorMsg(new Glib::ustring); - AsyncState state = storage->checkTransport(tokenPtr, - errorMsg); - - Gtk::TreeRow row = *treeModel->append(); - row[modelColumns.directionColumn] = isUpload ? uploadSymbol - : downloadSymbol; - row[modelColumns.titleColumn] = title; - row[modelColumns.dateColumn] = date; - row[modelColumns.tokenColumn] = tokenPtr; - setStatus(row, state, errorMsg); -} - - -/*------------------------------------------------------------------------------ - * Remove the currently selected item from the list. - *----------------------------------------------------------------------------*/ -void -TransportList :: removeSelected(void) throw (XmlRpcException) -{ - Glib::RefPtr selection = treeView->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (!iter) { - return; - } - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref sessionId = gLiveSupport->getSessionId(); - - storage->cancelTransport(sessionId, - iter->get_value(modelColumns.tokenColumn)); - - treeModel->erase(iter); -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending transport. - *----------------------------------------------------------------------------*/ -bool -TransportList :: updateSelected(void) throw (XmlRpcException) -{ - Glib::RefPtr selection = treeView->get_selection(); - Gtk::TreeIter iter = selection->get_selected(); - if (!iter) { - return false; - } else { - return update(iter); - } -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending transport. - *----------------------------------------------------------------------------*/ -bool -TransportList :: update(void) throw (XmlRpcException) -{ - bool didSomething = false; - - for (Gtk::TreeIter it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - didSomething |= update(it); - } - - return didSomething; -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending transport. - *----------------------------------------------------------------------------*/ -bool -TransportList :: updateSilently(void) throw () -{ - bool didSomething = false; - - for (Gtk::TreeIter it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - try { - didSomething |= update(it); - } catch (XmlRpcException &e) { - } - } - - return didSomething; -} - - -/*------------------------------------------------------------------------------ - * Query the storage server about the status of the pending transport. - *----------------------------------------------------------------------------*/ -bool -TransportList :: update(Gtk::TreeIter iter) throw (XmlRpcException) -{ - if (iter->get_value(modelColumns.statusColumn) != workingStatusKey) { - return false; - } - - Ptr::Ref - storage = gLiveSupport->getStorageClient(); - Ptr::Ref errorMsg(new Glib::ustring); - AsyncState status = storage->checkTransport( - iter->get_value(modelColumns.tokenColumn), - errorMsg); - - return setStatus(iter, status, errorMsg); -} - - -/*------------------------------------------------------------------------------ - * Set the status of the row pointed to by an iterator. - *----------------------------------------------------------------------------*/ -bool -TransportList :: setStatus(Gtk::TreeIter iter, - AsyncState status, - Ptr::Ref errorMsg) - throw () -{ - if (status == AsyncState::initState - || status == AsyncState::pendingState) { - iter->set_value(modelColumns.statusColumn, - workingStatusKey); - iter->set_value(modelColumns.statusDisplayColumn, - *getResourceUstring(workingStatusKey)); - return false; - - } else if (status == AsyncState::finishedState - || status == AsyncState::closedState) { - iter->set_value(modelColumns.statusColumn, - successStatusKey); - iter->set_value(modelColumns.statusDisplayColumn, - *getResourceUstring(successStatusKey)); - return true; - - } else if (status == AsyncState::failedState) { - iter->set_value(modelColumns.statusColumn, - faultStatusKey); - iter->set_value(modelColumns.statusDisplayColumn, - *formatMessage(faultStatusKey, - *processException(errorMsg))); - return false; - - } else { - std::cerr << "Impossible status: '" << status - << "' in TransportList::setStatus()." - << std::endl; - } - - return false; -} - - -/*------------------------------------------------------------------------------ - * Return the contents of the transport list. - *----------------------------------------------------------------------------*/ -Ptr::Ref -TransportList :: getContents(void) throw () -{ - std::ostringstream contentsStream; - Gtk::TreeModel::const_iterator it; - Ptr::Ref token; - - for (it = treeModel->children().begin(); - it != treeModel->children().end(); ++it) { - Gtk::TreeRow row = *it; - if (row[modelColumns.statusColumn] == workingStatusKey) { - if (row[modelColumns.directionColumn] == uploadSymbol) { - contentsStream << "up\n"; - } else { - contentsStream << "down\n"; - } - contentsStream << row[modelColumns.titleColumn] << '\n'; - contentsStream << row[modelColumns.dateColumn] << '\n'; - token = row[modelColumns.tokenColumn]; - contentsStream << *token << '\n'; - } - } - - Ptr::Ref contents(new Glib::ustring( - contentsStream.str() )); - return contents; -} - - -/*------------------------------------------------------------------------------ - * Restore the contents of the transport list. - *----------------------------------------------------------------------------*/ -void -TransportList :: setContents(Ptr::Ref contents) - throw () -{ - std::istringstream contentsStream(contents->raw()); - - treeModel->clear(); - while (!contentsStream.eof()) { - std::string direction; - std::string title; - std::string date; - std::string token; - - std::getline(contentsStream, direction); - if (contentsStream.fail()) { - break; - } - std::getline(contentsStream, title); - if (contentsStream.fail()) { - break; - } - std::getline(contentsStream, date); - if (contentsStream.fail()) { - break; - } - std::getline(contentsStream, token); - if (contentsStream.fail()) { - break; - } - - try { - add(title, date, token, (direction == "up")); - - } catch (XmlRpcException &e) { - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for an entry being clicked in the list. - *----------------------------------------------------------------------------*/ -void -TransportList :: onEntryClicked(GdkEventButton * event) throw () -{ - if (event->type == GDK_BUTTON_PRESS && event->button == 3) { - Gtk::TreePath currentPath; - Gtk::TreeViewColumn * column; - int cell_x, - cell_y; - bool foundValidRow = treeView->get_path_at_pos( - int(event->x), int(event->y), - currentPath, column, - cell_x, cell_y); - - if (foundValidRow) { - Gtk::TreeIter iter = treeModel->get_iter(currentPath); - if (iter) { - Gtk::TreeRow row = *iter; - if (row[modelColumns.directionColumn] == uploadSymbol) { - uploadMenu->popup(event->button, event->time); - } else { - downloadMenu->popup(event->button, event->time); - } - } - } - } -} - - -/*------------------------------------------------------------------------------ - * Event handler for "cancel" selected from the pop-up menu. - *----------------------------------------------------------------------------*/ -void -TransportList :: onCancelTransport(void) throw () -{ - try { - removeSelected(); - - } catch (XmlRpcException &e) { - gLiveSupport->displayMessageWindow(*formatMessage( - "cannotCancelTransportMsg", - e.what() )); - } -} - - -/*------------------------------------------------------------------------------ - * Handle some known exception types. - *----------------------------------------------------------------------------*/ -Ptr::Ref -TransportList :: processException(Ptr::Ref rawMessage) - throw () -{ - if (rawMessage->find("[888]") != Glib::ustring::npos) { - return getResourceUstring("duplicateFileMsg"); - } else { - return rawMessage; - } -} - diff --git a/src/products/gLiveSupport/src/TransportList.h b/src/products/gLiveSupport/src/TransportList.h deleted file mode 100644 index c46cae537..000000000 --- a/src/products/gLiveSupport/src/TransportList.h +++ /dev/null @@ -1,395 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef TransportList_h -#define TransportList_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "LiveSupport/Widgets/ZebraTreeModelColumnRecord.h" -#include "LiveSupport/Widgets/ZebraTreeView.h" -#include "GLiveSupport.h" - -#include "GuiComponent.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The list of pending transports. - * - * This is a Gtk::VBox containing a TreeView with the following columns: - *
    - *
  • shown: - *
      - *
    • the direction of the transfer (upload or download)
    • - *
    • the title of the transported file
    • - *
    • transport date
    • - *
    • transport status (localized; contains the fault string, if any)
    • - *
  • - *
  • hidden: - *
      - *
    • token
    • - *
    • transport status (not localized: - * "working" / "success" / "fault")
    • - *
  • - *
- * - * The TransportList is contained in the SearchWindow. - * - */ -class TransportList : public GuiComponent, - public ContentsStorable -{ - private: - - /** - * The user preferences key. - */ - Ptr::Ref userPreferencesKey; - - /** - * Set the status of the row pointed to by an iterator. - * - * @param iter points to the row we want to set the status of. - * @param status the new status ("working", "success" or "fault"). - * @param errorMessage the error message (for status "fault"); - * optional - * @return true if the status is "success", false otherwise. - */ - bool - setStatus(Gtk::TreeIter iter, - AsyncState status, - Ptr::Ref errorMsg - = Ptr::Ref()) - throw (); - - /** - * Add an item with an already existing token to the list. - * - * @param title the title of the transport. - * @param date the date of the transport. - * @param token the token for this transport. - * @param isUpload true if this is an upload transfer; - * false if this is a download transfer. - * @exception XmlRpcException thrown by the storage client. - */ - void - add(const Glib::ustring & title, - const Glib::ustring & date, - const Glib::ustring & token, - bool isUpload) - throw (XmlRpcException); - - /** - * Query the storage server about the status of the given row. - * If its status is 'working', call getTransportInfo - * on it, and change its displayed status, if needed. - * - * @param iter points to the row to be updated. - * @return true if getTransportInfo was called, and it returned - * 'success'; false in all other cases. - * @exception XmlRpcException thrown by the storage client. - */ - bool - update(Gtk::TreeIter iter) throw (XmlRpcException); - - /** - * Handle some known exception types. - * - * @param rawMessage the error message to be processed. - * @return a localized error message if rawMessage contains - * [xxx], where xxx is a recognized error code. - */ - Ptr::Ref - processException(Ptr::Ref rawMessage) - throw (); - - - protected: - - /** - * The columns model needed by ZebraTreeView. - * - */ - class ModelColumns : public ZebraTreeModelColumnRecord - { - public: - /** - * The column for the direction of the transport (up/down). - */ - Gtk::TreeModelColumn directionColumn; - - /** - * The column for the title of the transported file. - */ - Gtk::TreeModelColumn titleColumn; - - /** - * The column for the date of the transport. - */ - Gtk::TreeModelColumn dateColumn; - - /** - * The column for the status of the transport (not localized). - */ - Gtk::TreeModelColumn statusColumn; - - /** - * The column for the status of the transport (localized). - */ - Gtk::TreeModelColumn statusDisplayColumn; - - /** - * The column for the token corresponding to the transport. - */ - Gtk::TreeModelColumn::Ref> - tokenColumn; - - /** - * Constructor. - */ - ModelColumns(void) throw () - { - add(directionColumn); - add(titleColumn); - add(dateColumn); - add(statusColumn); - add(statusDisplayColumn); - add(tokenColumn); - } - }; - - - /** - * The column model. - */ - ModelColumns modelColumns; - - /** - * The tree model, as a GTK reference. - */ - Glib::RefPtr treeModel; - - /** - * The tree view. - */ - ZebraTreeView * treeView; - - /** - * The pop-up menu for uploads. - */ - Ptr::Ref uploadMenu; - - /** - * The pop-up menu for downloads. - */ - Ptr::Ref downloadMenu; - - /** - * Event handler for an entry being clicked in the list. - * This is used to pop up the right-click context menu. - * - * @param event the button event recieved - */ - void - onEntryClicked(GdkEventButton * event) throw (); - - /** - * Event handler for "cancel" selected from the pop-up menu. - */ - void - onCancelTransport(void) throw (); - - - public: - - /** - * Constructor. - * - * @param parent the GuiObject which contains this one. - */ - TransportList(GuiObject * parent) throw (); - - /** - * Virtual destructor. - */ - virtual - ~TransportList(void) throw () - { - } - - /** - * Add a new upload task to the list. - * - * @param playable the playable object to be uploaded to the - * network hub. - * @exception XmlRpcException thrown by the storage client. - */ - void - addUpload(Ptr::Ref playable) - throw (XmlRpcException); - - /** - * Add a new download task to the list. - * - * The playable parameter can be an incomplete object; - * all it needs to have is a unique ID, a type (audio clip or - * playlist), and a title. - * - * @param playable the playable object to be downloaded from the - * network hub. - * @exception XmlRpcException thrown by the storage client. - */ - void - addDownload(Ptr::Ref playable) - throw (XmlRpcException); - - /** - * Remove the currently selected item from the list. - * - * The doTransportAction storage function is - * called on the transport task with the cancel parameter, - * and it is removed from the tree model. - * - * @exception XmlRpcException thrown by the storage client. - */ - void - removeSelected(void) throw (XmlRpcException); - - /** - * Query the storage server about the status of the selected row. - * - * If its status is 'working', call getTransportInfo - * on it, and change its displayed status, if needed. - * - * @return true if getTransportInfo was called, and it returned - * 'success'; false in all other cases. - * @exception XmlRpcException thrown by the storage client. - */ - bool - updateSelected(void) throw (XmlRpcException); - - /** - * Query the storage server about the status of the pending transport. - * - * If there is a transport with status 'working', call getTransportInfo - * on it, and change its displayed status, if needed. - * - * @return true if getTransportInfo was called, and it returned - * at least one 'success'; false in all other cases. - * @exception XmlRpcException thrown by the storage client. - */ - bool - update(void) throw (XmlRpcException); - - /** - * Query the storage server about the status of the pending transport. - * - * If there is a transport with status 'working', call getTransportInfo - * on it, and change its displayed status, if needed. - * - * This is the same as update(), except it does not throw any - * exceptions (just ignores them). - * - * @return true if getTransportInfo was called, and it returned - * at least one 'success'; false in all other cases. - */ - bool - updateSilently(void) throw (); - - /** - * Return the contents of the transport list. - * - * The format is a newline-separated list of transport directions, - * titles, dates and tokens. - * E.g.: "up title1 date1 token1 down title2 date2 token2". - * - * @return the contents of the transport list as a string. - */ - Ptr::Ref - getContents(void) throw (); - - /** - * Restore the contents of the transport list. - * - * The current contents are discarded, and replaced with the items - * listed in the 'contents' parameter. - * The format is a newline-separated list of transport directions, - * titles, dates and tokens. - * E.g.: "up title1 date1 token1 down title2 date2 token2". - * - * @param contents the new contents of the transport list as a string. - */ - void - setContents(Ptr::Ref contents) throw (); - - /** - * Return the user preferences key. - * - * The contents of the window will be stored in the user preferences - * under this key. - * - * @return the user preference key. - */ - Ptr::Ref - getUserPreferencesKey(void) throw () - { - return userPreferencesKey; - } -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // TransportList_h - diff --git a/src/products/gLiveSupport/src/UploadFileWindow.cxx b/src/products/gLiveSupport/src/UploadFileWindow.cxx deleted file mode 100644 index 988b70a68..000000000 --- a/src/products/gLiveSupport/src/UploadFileWindow.cxx +++ /dev/null @@ -1,567 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include // for ICU -#include // for TagLib -#include // for TagLib - -#include "LiveSupport/Core/Debug.h" -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Core/FileTools.h" - -#include "UploadFileWindow.h" - - -using namespace LiveSupport::GLiveSupport; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the localization resource bundle. - *----------------------------------------------------------------------------*/ -const Glib::ustring bundleName = "uploadFileWindow"; - -/*------------------------------------------------------------------------------ - * The name of the glade file. - *----------------------------------------------------------------------------*/ -const Glib::ustring gladeFileName = "UploadFileWindow.glade"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -UploadFileWindow :: UploadFileWindow ( - Gtk::ToggleButton * windowOpenerButton) - throw () - : GuiWindow(bundleName, - gladeFileName, - windowOpenerButton), - fileType(invalidType) -{ - Gtk::Label * fileNameLabel; - glade->get_widget("fileNameLabel1", fileNameLabel); - glade->get_widget("fileNameEntry1", fileNameEntry); - glade->get_widget("browseButton1", browseButton); - fileNameLabel->set_label(*getResourceUstring("chooseFileLabel")); - browseButton->set_label(*getResourceUstring("chooseFileButtonLabel")); - fileNameEntry->signal_focus_out_event().connect(sigc::mem_fun(*this, - &UploadFileWindow::onFileNameEntryLeave)); - browseButton->signal_clicked().connect(sigc::mem_fun(*this, - &UploadFileWindow::onBrowseButtonClicked)); - - Gtk::Label * mainTabLabel; - Gtk::Label * musicTabLabel; - Gtk::Label * voiceTabLabel; - glade->get_widget("mainTabLabel1", mainTabLabel); - glade->get_widget("musicTabLabel1", musicTabLabel); - glade->get_widget("voiceTabLabel1", voiceTabLabel); - mainTabLabel->set_label(*getResourceUstring("mainSectionLabel")); - musicTabLabel->set_label(*getResourceUstring("musicSectionLabel")); - voiceTabLabel->set_label(*getResourceUstring("voiceSectionLabel")); - - Ptr::Ref - metadataTypes = gLiveSupport->getMetadataTypeContainer(); - - mainCounter = 0; - musicCounter = 0; - voiceCounter = 0; - MetadataTypeContainer::Vector::const_iterator it; - for (it = metadataTypes->begin(); it != metadataTypes->end(); ++it) { - Ptr::Ref metadata = *it; - Gtk::Entry * metadataEntry = constructMetadataItem(metadata); - if (metadataEntry) { - metadataKeys.push_back(metadata->getDcName()); - metadataEntries.push_back(metadataEntry); - } - } - - Gtk::Label * lengthLabel; - glade->get_widget("lengthLabel1", lengthLabel); - glade->get_widget("lengthValueLabel1", lengthValueLabel); - lengthLabel->set_label(*getResourceUstring("lengthLabel")); - lengthValueLabel->set_label("00:00:00"); - - glade->get_widget("statusBar1", statusBar); - statusBar->set_text(""); - - glade->connect_clicked("uploadButton1", sigc::mem_fun(*this, - &UploadFileWindow::onUploadButtonClicked)); - glade->connect_clicked("cancelButton1", sigc::mem_fun(*this, - &UploadFileWindow::onCancelButtonClicked)); - - fileChooserFolder = Glib::get_home_dir(); -} - - -/*------------------------------------------------------------------------------ - * Display the given metadata entry field in the appropriate tab. - *----------------------------------------------------------------------------*/ -Gtk::Entry * -UploadFileWindow :: constructMetadataItem( - Ptr::Ref metadata) - throw () -{ - Gtk::Entry * entry = 0; - - MetadataType::TabType tab = metadata->getTab(); - - switch (tab) { - case MetadataType::mainTab : - entry = constructMetadataItem(metadata, "main", mainCounter); - ++mainCounter; - break; - - case MetadataType::musicTab : - entry = constructMetadataItem(metadata, "music", musicCounter); - ++musicCounter; - break; - - case MetadataType::voiceTab : - entry = constructMetadataItem(metadata, "voice", voiceCounter); - ++voiceCounter; - break; - - case MetadataType::noTab : // added to prevent compiler - break; // warning about missing case - } - - return entry; -} - - -/*------------------------------------------------------------------------------ - * Display the given metadata entry field in the appropriate tab. - *----------------------------------------------------------------------------*/ -Gtk::Entry * -UploadFileWindow :: constructMetadataItem( - Ptr::Ref metadata, - const Glib::ustring & tabName, - int index) - throw () -{ - Gtk::Box * metadataBox; - Gtk::Label * metadataLabel; - Gtk::Entry * metadataEntry; - - glade->get_widget(tabName + "Box" + itoa(index + 1), metadataBox); - glade->get_widget(tabName + "MetadataLabel" + itoa(index + 1), - metadataLabel); - glade->get_widget(tabName + "MetadataEntry" + itoa(index + 1), - metadataEntry); - - metadataBox->show(); - metadataLabel->set_label(*metadata->getLocalizedName()); - return metadataEntry; -} - - -/*------------------------------------------------------------------------------ - * The event when the choose file button has been clicked. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: onBrowseButtonClicked(void) throw () -{ - Ptr::Ref dialog(new Gtk::FileChooserDialog( - *getResourceUstring("fileChooserDialogTitle"), - Gtk::FILE_CHOOSER_ACTION_OPEN)); - dialog->set_name("uploadFileChooserDialog"); - - dialog->set_current_folder(fileChooserFolder); - dialog->set_transient_for(*mainWindow); - - //Add response buttons the the dialog: - dialog->add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - dialog->add_button(Gtk::Stock::OPEN, Gtk::RESPONSE_OK); - - int result = dialog->run(); - - if (result == Gtk::RESPONSE_OK) { - clearEverything(); - fileNameEntry->set_text(dialog->get_filename()); - updateFileInfo(); - fileChooserFolder = dialog->get_current_folder(); - } -} - - -/*------------------------------------------------------------------------------ - * Update the file information to upload. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: updateFileInfo(void) throw () -{ - Glib::ustring fileName = fileNameEntry->get_text(); - - // do not display bogus error msg for point-to-focus users - if (fileName == "") { - return; - } - - // see if the file exists, and is readable - std::ifstream file(fileName.c_str()); - if (!file.good()) { - file.close(); - statusBar->set_text(*getResourceUstring("couldNotOpenFileMsg")); - fileType = invalidType; - return; - } - file.close(); - - fileType = determineFileType(fileName); - - switch (fileType) { - case audioClipType: readAudioClipInfo(fileName); - break; - - case playlistArchiveType: statusBar->set_text(""); - break; - - case storageArchiveType: statusBar->set_text(""); - break; - - case invalidType: statusBar->set_text(*getResourceUstring( - "unsupportedFileTypeMsg")); - break; - } -} - - -/*------------------------------------------------------------------------------ - * Read the playlength and metadata info from the binary audio file. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: readAudioClipInfo(const Glib::ustring & fileName) - throw () -{ - Ptr::Ref newUri(new std::string("file://")); - newUri->append(fileName); - - Ptr::Ref playlength; - try { - playlength = readPlaylength(fileName); - } catch (std::invalid_argument &e) { - statusBar->set_text(*getResourceUstring("unsupportedFileTypeMsg")); - fileType = invalidType; - return; - } - if (!playlength) { - statusBar->set_text(*getResourceUstring("couldNotReadLengthMsg")); - playlength.reset(new time_duration(0,0,0,0)); - } - - // display the new play length - Ptr::Ref lengthStr - = TimeConversion::timeDurationToHhMmSsString( - playlength); - lengthValueLabel->set_text(*lengthStr); - - // read the id3 tags - Ptr::Ref tempTitle(new const Glib::ustring); - audioClip.reset(new AudioClip(tempTitle, playlength, newUri)); - - try { - audioClip->readTag(gLiveSupport->getMetadataTypeContainer()); - } catch (std::invalid_argument &e) { - statusBar->set_text(e.what()); - fileType = invalidType; - return; - } - - for (unsigned int i=0; i < metadataKeys.size(); ++i) { - Ptr::Ref metadataKey = metadataKeys[i]; - Gtk::Entry * metadataEntry = metadataEntries[i]; - - Ptr::Ref metadataValue - = audioClip->getMetadata(*metadataKey); - if (metadataValue) { - metadataEntry->set_text(*metadataValue); - } - } - - statusBar->set_text(""); -} - - -/*------------------------------------------------------------------------------ - * The event when the user has left the file name entry box. - *----------------------------------------------------------------------------*/ -bool -UploadFileWindow :: onFileNameEntryLeave(GdkEventFocus * event) - throw () -{ - updateFileInfo(); - return false; -} - - -/*------------------------------------------------------------------------------ - * The event when the upload button has been clicked. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: onUploadButtonClicked(void) throw () -{ - switch (fileType) { - case audioClipType: uploadAudioClip(); - break; - - case playlistArchiveType: uploadPlaylistArchive(); - break; - - case storageArchiveType: uploadStorageArchive(); - break; - - case invalidType: break; - } -} - - -/*------------------------------------------------------------------------------ - * Upload an audio clip to the storage. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: uploadAudioClip(void) throw () -{ - Ptr::Ref - metadataTypes = gLiveSupport->getMetadataTypeContainer(); - - for (unsigned int i=0; i < metadataKeys.size(); ++i) { - Ptr::Ref metadataKey = metadataKeys[i]; - Gtk::Entry * metadataEntry = metadataEntries[i]; - - Ptr::Ref metadataValue(new Glib::ustring( - metadataEntry->get_text() )); - if (*metadataValue != "") { - if (metadataTypes->check(metadataValue, *metadataKey)) { - audioClip->setMetadata(metadataValue, *metadataKey); - } else { - Ptr::Ref - metadata = metadataTypes->getByDcName(*metadataKey); - Ptr::Ref - localizedName = metadata->getLocalizedName(); - statusBar->set_text(*formatMessage("badMetadataMsg", - *localizedName)); - return; - } - } - } - - Ptr::Ref title = audioClip->getTitle(); - if (!title || *title == "") { - statusBar->set_text(*getResourceUstring("missingTitleMsg")); - return; - } - - try { - gLiveSupport->uploadAudioClip(audioClip); - - } catch (XmlRpcMethodFaultException &e) { - statusBar->set_text(*processException(e)); - return; - - } catch (XmlRpcException &e) { - statusBar->set_text(e.what()); - std::cerr << e.what(); - return; - } - - clearEverything(); - statusBar->set_text(*formatMessage("fileUploadedMsg", - *audioClip->getTitle() )); - hide(); -} - - -/*------------------------------------------------------------------------------ - * Upload a playlist archive to the storage. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: uploadPlaylistArchive(void) throw () -{ - Ptr::Ref path(new const Glib::ustring( - fileNameEntry->get_text() )); - - Ptr::Ref playlist; - try { - playlist = gLiveSupport->uploadPlaylistArchive(path); - - } catch (XmlRpcMethodFaultException &e) { - statusBar->set_text(*processException(e)); - return; - - } catch (XmlRpcException &e) { - statusBar->set_text(e.what()); - return; - } - - clearEverything(); - statusBar->set_text(*formatMessage("fileUploadedMsg", - *playlist->getTitle() )); - hide(); -} - - -/*------------------------------------------------------------------------------ - * Upload a storage archive to the storage. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: uploadStorageArchive(void) throw () -{ - Ptr::Ref path(new const Glib::ustring( - fileNameEntry->get_text() )); - - Ptr::Ref restoreBackupWindow( - new RestoreBackupWindow(path)); - restoreBackupWindow->show(); - restoreBackupWindowList.push_back(restoreBackupWindow); - - clearEverything(); - hide(); -} - - -/*------------------------------------------------------------------------------ - * The event when the close button has been clicked. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: onCancelButtonClicked(void) throw () -{ - clearEverything(); - hide(); -} - - -/*------------------------------------------------------------------------------ - * Determine the length of an audio file - *----------------------------------------------------------------------------*/ -Ptr::Ref -UploadFileWindow :: readPlaylength(const Glib::ustring & fileName) - throw (std::invalid_argument) -{ - // TODO: use the appropriate TagLib::X::File subclass constructors, - // once we find some way of determining the MIME type. - TagLib::FileRef fileRef(fileName.c_str()); - if (fileRef.isNull()) { - throw std::invalid_argument("unsupported file type"); - } - - TagLib::AudioProperties * audioProperties = fileRef.audioProperties(); - Ptr::Ref length; - if (audioProperties) { - length.reset(new time_duration( - seconds( audioProperties->length() ) - + microseconds(audioProperties->length_microseconds()) )); - } - return length; -} - - -/*------------------------------------------------------------------------------ - * Determine the type of the given file. - *----------------------------------------------------------------------------*/ -UploadFileWindow::FileType -UploadFileWindow :: determineFileType(const Glib::ustring & fileName) - throw () -{ - unsigned int dotPosition = fileName.rfind('.'); - if (dotPosition == std::string::npos) { - return invalidType; - } - - Glib::ustring extension = fileName.substr(dotPosition).lowercase(); - if (extension == ".mp3" || extension == ".ogg") { - return audioClipType; - - } else if (extension == ".tar") { - if (FileTools::existsInTarball(fileName, "exportedPlaylist.lspl")) { - return playlistArchiveType; - } else if (FileTools::existsInTarball( - fileName, "meta-inf/storage.xml")) { - return storageArchiveType; - } else { - return invalidType; - } - - } else { - return invalidType; - } -} - - -/*------------------------------------------------------------------------------ - * Clear all the input fields and set the fileType to 'invalidType'. - *----------------------------------------------------------------------------*/ -void -UploadFileWindow :: clearEverything(void) throw () -{ - fileNameEntry->set_text(""); - for (unsigned int i = 0; i < metadataEntries.size(); ++i) { - Gtk::Entry * metadataEntry = metadataEntries[i]; - metadataEntry->set_text(""); - } - statusBar->set_text(""); - fileType = invalidType; -} - - -/*------------------------------------------------------------------------------ - * Handle some known exception types. - *----------------------------------------------------------------------------*/ -Ptr::Ref -UploadFileWindow :: processException(const XmlRpcMethodFaultException & e) - throw () -{ - Ptr::Ref message; - - if (e.getFaultCode() == 888) { - message = getResourceUstring("duplicateFileMsg"); - - } else { - message.reset(new const Glib::ustring(e.what())); - } - - std::cerr << e.what() << std::endl; - - return message; -} - - diff --git a/src/products/gLiveSupport/src/UploadFileWindow.h b/src/products/gLiveSupport/src/UploadFileWindow.h deleted file mode 100644 index ba1376c3e..000000000 --- a/src/products/gLiveSupport/src/UploadFileWindow.h +++ /dev/null @@ -1,328 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef UploadFileWindow_h -#define UploadFileWindow_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Widgets/ComboBoxText.h" -#include "RestoreBackupWindow.h" -#include "GLiveSupport.h" - -#include "GuiWindow.h" -#include "LiveSupport/Core/NumericTools.h" - - -namespace LiveSupport { -namespace GLiveSupport { - -using namespace LiveSupport::Core; -using namespace LiveSupport::Widgets; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The upload file window. - * - * It allows one to select a file from the file system, add metadata, - * and upload it to the storage server. - * - */ -class UploadFileWindow : public GuiWindow, - private NumericTools -{ - private: - - /** - * The text entry for selecting a file name - */ - Gtk::Entry * fileNameEntry; - - /** - * The file browser button. - */ - Gtk::Button * browseButton; - - /** - * A list of the Dublin Core names of the metadata fields. - */ - std::vector::Ref> - metadataKeys; - - /** - * A list of the metadata entry fields. - */ - std::vector metadataEntries; - - /** - * A counter for the metadata entries in the Main tab. - */ - int mainCounter; - - /** - * A counter for the metadata entries in the Music tab. - */ - int musicCounter; - - /** - * A counter for the metadata entries in the Voice tab. - */ - int voiceCounter; - - /** - * The length value label. - */ - Gtk::Label * lengthValueLabel; - - /** - * The upload button. - */ - Gtk::Button * uploadButton; - - /** - * The cancel button. - */ - Gtk::Button * cancelButton; - - /** - * The status bar. - */ - Gtk::Label * statusBar; - - /** - * The audio clip to be uploaded. - */ - Ptr::Ref audioClip; - - /** - * The restore backup windows opened by this window. - */ - std::vector::Ref> - restoreBackupWindowList; - - /** - * The possible file types. - */ - typedef enum { audioClipType, - playlistArchiveType, - storageArchiveType, - invalidType } - FileType; - - /** - * The type of the currently selected file. - */ - FileType fileType; - - /** - * The starting folder for the file chooser dialog. - */ - Glib::ustring fileChooserFolder; - - /** - * Construct the metadata entry item. - * - * @param metadata the metadata to display in the entry. - * @return the entry field for the metadata. - */ - Gtk::Entry * - constructMetadataItem(Ptr::Ref metadata) - throw (); - - /** - * Construct the metadata entry item. - * This is an auxiliary method, called by the other method with - * the same name. - * - * @param metadata the metadata to display in the entry. - * @param tabName the name of the tab: "main", "music" or "voice". - * @param index the index of the item in its tab. - * @return the entry field for the metadata. - */ - Gtk::Entry * - constructMetadataItem(Ptr::Ref metadata, - const Glib::ustring & tabName, - int index) - throw (); - - /** - * Update the information for the file to upload, based on the - * value of the fileNameEntry text entry field. - */ - void - updateFileInfo(void) throw (); - - /** - * Read the playlength and metadata info from the binary audio file. - * - * @param fileName the local file name (with path) for the - * binary audio file. - */ - void - readAudioClipInfo(const Glib::ustring & fileName) - throw (); - - /** - * Determine the length of an audio file on disk. - * - * @param fileName a binary audio file (e.g., /tmp/some_clip.mp3) - * @return the length of the file; a null pointer if the - * length could not be read (see bug #1426) - * @exception std::invalid_argument if the file is not found, or its - * format is not supported by TagLib - */ - Ptr::Ref - readPlaylength(const Glib::ustring & fileName) - throw (std::invalid_argument); - - /** - * Upload an audio clip to the storage. - */ - void - uploadAudioClip(void) throw (); - - /** - * Upload a playlist archive to the storage. - */ - void - uploadPlaylistArchive(void) throw (); - - /** - * Upload a storage archive to the storage. - */ - void - uploadStorageArchive(void) throw (); - - /** - * Determine the type of the given file. - * - * This method looks at the extension only. - * TODO: replace this with proper mime-type detection - * (gnomevfs, system("file fileName"), or ...?) - * - * @param fileName the name (with path) of the local file. - * @return the type of the file. - */ - FileType - determineFileType(const Glib::ustring & fileName) - throw (); - - /** - * Clear all the input fields and set the fileType to 'invalidType'. - */ - void - clearEverything(void) throw (); - - /** - * Handle some known exception types. - * - * @param e the exception to be processed. - * @return a localized error message if e has one of the recognized - * faultCode values; e.what() if not. - */ - Ptr::Ref - processException(const XmlRpcMethodFaultException & e) - throw (); - - - protected: - - /** - * Function to catch the event of the choose file button being - * pressed. - */ - virtual void - onBrowseButtonClicked(void) throw (); - - /** - * Function to catch the event of the upload button being - * pressed. - */ - virtual void - onUploadButtonClicked(void) throw (); - - /** - * Signal handler for the user leaving the filename entry box, - * where persumably he may have types in a new filename. - * - * @param event the event recieved. - * @return true if the event has been processed, false otherwise. - */ - virtual bool - onFileNameEntryLeave(GdkEventFocus * event) throw (); - - /** - * Function to catch the event of the cancel button being pressed. - */ - virtual void - onCancelButtonClicked(void) throw (); - - - public: - - /** - * Constructor. - * - * @param windowOpenerButton the button which was pressed to open - * this window. - */ - UploadFileWindow(Gtk::ToggleButton * windowOpenerButton) - throw (); - - /** - * Virtual destructor. - */ - virtual - ~UploadFileWindow(void) throw () - { - } - -}; - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace GLiveSupport -} // namespace LiveSupport - -#endif // UploadFileWindow_h - diff --git a/src/products/gLiveSupport/src/main.cxx b/src/products/gLiveSupport/src/main.cxx deleted file mode 100644 index f7c0a6add..000000000 --- a/src/products/gLiveSupport/src/main.cxx +++ /dev/null @@ -1,214 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/** @file - * This file contains the main entry point to the Studio client. - */ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/LocalizedObject.h" - -#include "GLiveSupport.h" - -using namespace LiveSupport::Core; -using namespace LiveSupport::GLiveSupport; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -namespace { - -/** - * Our copyright notice, should be at most 80 columns - */ -const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -const char options[] = "c:hv"; - -/** - * Structure describing the long options - */ -const struct option longOptions[] = - { - { "config", required_argument, 0, 'c' }, - { "help", no_argument, 0, 'h' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } - }; - -} - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -void -printUsage ( const char invocation[], - std::ostream & os ); - - -/* ============================================================= module code */ - -/** - * Program entry point. - * - * @param argc the number of command line arguments passed by the user. - * @param argv the command line arguments passed by the user. - * @return 0 on success, non-0 on failure. - */ -int main ( int argc, - char * argv[] ) -{ - // initialize the Gtk library, with the Gtk options first - Gtk::Main kit(argc, argv); - - // take a look at our options - int i; - std::string configFileName; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'c': - configFileName = optarg; - break; - - case 'h': - printUsage(argv[0], std::cout); - return 0; - - case 'v': - printVersion(std::cout); - return 0; - - default: - printUsage(argv[0], std::cout); - return 1; - } - } - - if (optind != argc) { - printUsage(argv[0], std::cout); - return 1; - } - - Ptr::Ref - gLiveSupport = LiveSupport::GLiveSupport::GLiveSupport::getInstance(); - - try { - std::auto_ptr - parser(new xmlpp::DomParser(configFileName, false)); - const xmlpp::Document * document = parser->get_document(); - gLiveSupport->configure(*(document->get_root_node())); - } catch (std::invalid_argument &e) { - std::cerr << "error in configuration file: " - << e.what() << std::endl; - return 1; - } catch (xmlpp::exception &e) { - std::cerr << "error parsing configuration file: " - << e.what() << std::endl; - return 1; - } catch (std::logic_error &e) { - std::cerr << "error while configuring: " - << e.what() << std::endl; - return 1; - } - - if (!gLiveSupport->checkConfiguration()) { - std::cerr << "error; please check your configuration file" << std::endl; - return 1; - } - - gLiveSupport->show(); - return 0; -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION]" - << std::endl - << " mandatory options:" << std::endl - << " -c, --config=file.name scheduler configuration file" << std::endl - << " optional options:" << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/products/gLiveSupport/tmp/.keepme b/src/products/gLiveSupport/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/products/gLiveSupport/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/products/gLiveSupport/var/.keepme b/src/products/gLiveSupport/var/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/products/gLiveSupport/var/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/products/gLiveSupport/var/campcaster.png b/src/products/gLiveSupport/var/campcaster.png deleted file mode 100644 index bb405bcc7..000000000 Binary files a/src/products/gLiveSupport/var/campcaster.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/en.txt b/src/products/gLiveSupport/var/en.txt deleted file mode 100644 index d59f768a0..000000000 --- a/src/products/gLiveSupport/var/en.txt +++ /dev/null @@ -1,3 +0,0 @@ -en:table -{ -} diff --git a/src/products/gLiveSupport/var/es.txt b/src/products/gLiveSupport/var/es.txt deleted file mode 100644 index a3e986632..000000000 --- a/src/products/gLiveSupport/var/es.txt +++ /dev/null @@ -1,466 +0,0 @@ -es:table -{ - cancelButtonLabel:string { "Cancel" } - noButtonLabel:string { "No" } - yesButtonLabel:string { "Yes" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Ubicación {0} no disponible" } - schedulerNotReachableMsg:string { "El servidor del programador no está disponible" } - storageNotReachableMsg:string { "El servidor de almacenamiento no está disponible" } - authenticationNotReachableMsg:string - { "El servidor de autenticación no está " - "disponible.\n" - "Would you like to edit the server " - "settings?" } - audioErrorMsg { "Error del reproductor de audio: " } - - masterPanelWindow:table - { - windowTitle:string { "Panel maestro" } - - notLoggedInMsg:string { "No ha ingresado al sistema" } - loggedInMsg:string { "Ingresó: {0}" } - loginButtonLabel:string { "Accesar" } - logoutButtonLabel:string { "Salir" } - liveModeButtonLabel:string { "En vivo" } - uploadFileButtonLabel:string { "Cargar archivo" } - scratchpadButtonLabel:string { "Scratchpad" } - playlistButtonLabel:string { "Lista de repr." } - schedulerButtonLabel:string { "Programador" } - searchButtonLabel:string { "Búsqueda" } - optionsButtonLabel:string { "Options" } - - elapsedTimeLabel:string { "elapsed" } - remainingTimeLabel:string { "remaining" } - - sureToExitMsg:string { "Are you sure you want to exit?" } - } - - loginWindow:table - { - windowTitle:string { "INGRESO" } - - userNameLabel:string { "Identificador" } - passwordLabel:string { "Clave de acceso" } - languageLabel:string { "#Language#" } - - pleaseWaitMsg:string { "Logging in, please wait." } - } - - audioClipListWindow:table - { - windowTitle:string { "Audio clip" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "duración" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "muestra" } - - closeButtonLabel:string { "cerrar" } - } - - scratchpadWindow:table - { - windowTitle:string { "Scratchpad" } - - creatorColumnLabel:string { "Creador" } - titleColumnLabel:string { "Título" } - addToPlaylistButtonLabel:string { "Añadir a lista de reproducción" } - clearListButtonLabel:string { "Limpiar la lista" } - removeButtonLabel:string { "Eliminar elemento(s)" } - - cueMenuItem:string { "Previsualizar" } - addToLiveModeMenuItem:string { "Añadir a modo en vivo" } - addToPlaylistMenuItem:string { "Añadir a lista de reproducción" } - removeMenuItem:string { "Eliminar" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "Programar lista de reproducción" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - playlistListWindow:table - { - windowTitle:string { "Lista de reproducción" } - - listBoxLabel { "Listas de reproducción" } - detailBoxLabel { "Detalles de las listas de reproducción" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "duración" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "muestra" } - - closeButtonLabel:string { "cerrar" } - } - - uploadFileWindow:table - { - windowTitle:string { "Cargar archivo" } - - chooseFileLabel:string { "Nombre del archivo" } - chooseFileButtonLabel:string { "Navegar" } - - mainSectionLabel:string { "Principal" } - musicSectionLabel:string { "Music" } - voiceSectionLabel:string { "Voice" } - - lengthLabel:string { "Duración" } - - uploadButtonLabel:string { "Cargar" } - closeButtonLabel:string { "Cancelar" } - - fileChooserDialogTitle:string { "Seleccione un archivo" } - fileUploadedMsg:string { "File ''{0}'' cargado." } - couldNotOpenFileMsg:string { "#The file could not be opened.#" } - couldNotReadLengthMsg:string { "#Could not determine audio clip " - "length.#" } - unsupportedFileTypeMsg:string { "#Unsupported file type.#" } - missingTitleMsg:string { "#Please enter a title.#" } - badMetadataMsg:string { "#Invalid data for {0}.#" } - duplicateFileMsg:string { "#Error: the file is in the storage " - "already.#" } - } - - playlistWindow:table - { - windowTitle:string { "Lista de reproducción" } - - startColumnLabel:string { "inicio" } - titleColumnLabel:string { "título" } - lengthColumnLabel:string { "duración" } - fadeInColumnLabel:string { "Fade in" } - fadeOutColumnLabel:string { "Fade out" } - - nameLabel:string { "nombre" } - lengthLabel:string { "Duration:" } - saveButtonLabel:string { "guardar" } - closeButtonLabel:string { "cerrar" } - lockFadesCheckButtonLabel:string - { "Lock fade-out to following fade-in" } - - upMenuItem:string { "Move _Up" } - downMenuItem:string { "Move D_own" } - removeMenuItem:string { "_Remove" } - - playlistSavedMsg:string { "lista de reproducción guardada {0}" } - savePlaylistDialogMsg:string { "Do you want to save the playlist?" } - closeWithoutSavingButtonLabel:string - { "#Close without Saving#" } - emptyTitleErrorMsg:string { "Please enter a title." } - } - - schedulerWindow:table - { - windowTitle:string { "Programador" } - - scheduleTab:string { "Schedule" } - statusTab:string { "Status" } - - startColumnLabel:string { "inicio" } - titleColumnLabel:string { "título" } - endColumnLabel:string { "fin" } - deleteMenuItem:string { "eliminar" } - - stopCurrentlyPlayingButtonLabel:string { "Stop" } - stopCurrentlyPlayingText:string { "what is currently playing " - "in the scheduler." } - stopCurrentlyPlayingDialogMsg:string { "Are you sure?" } - - closeButtonLabel:string { "cerrar" } - - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Listas de reproducción programadas" } - - hourLabel:string { "hora: " } - minuteLabel:string { "minuto: " } - secondLabel:string { "seconds: " } - scheduleButtonLabel:string { "programado" } - closeButtonLabel:string { "cerrar" } - } - - searchWindow:table - { - windowTitle:string { "Búsqueda/Navegación" } - - searchWhereLabel:string { "Search or browse on: " } - searchWhereLocal:string { "local storage" } - searchWhereRemote:string { "network hub" } - - simpleSearchTab:string { "Búsqueda" } - advancedSearchTab:string { "Búsqueda avanzada" } - browseTab:string { "Navegar" } - transportsTab:string { "Transfers" } - - searchButtonLabel:string { "Buscar" } - backwardButtonLabel:string { "⇦ Previous" } - forwardButtonLabel:string { "Next ⇨" } - searchResultsCountLabel:string { "{0}-{1} of {2} results" } - - typeColumnLabel:string { "Tipo" } - titleColumnLabel:string { "Título" } - creatorColumnLabel:string { "Creador" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Duración" } - - allStringForBrowse { "--- todo ---" } - - addToScratchpadMenuItem:string { "_Añadir a Scratchpad" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - addToLiveModeMenuItem:string { "Añadir a Modo en vivo" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to the network hub" } - downloadFromHubMenuItem:string { "Download from the network hub" } - - pleaseWaitMsg:string { "Please wait..." } - shortErrorMsg:string { "Search failed." } - longErrorMsg:string { "Search failed: {0}." } - uploadToHubErrorMsg:string { "Uploading to hub failed: {0}." } - downloadFromHubErrorMsg:string { "Downloading from hub failed: {0}." } - nothingFoundMsg:string { "No files found." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "File types" } - allFileType:string { "all" } - audioClipFileType:string { "audio clips" } - playlistFileType:string { "playlists" } - - searchByTextLabel:string { "Buscar por" } - - partialOperatorDisplay:string { "contiene" } - prefixOperatorDisplay:string { "empieza con" } - =OperatorDisplay:string { "equivale" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Modo en vivo" } - - playMenuItem:string { "Reproduccir" } - cueMenuItem:string { "Previsualizar" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - removeMenuItem:string { "Eliminar" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cuePlayerLabel:string { "Previsualizar" } - autoPlayNextLabel:string { "#Play the next item automatically#" } - - clearListButtonLabel:string { "Clear list" } - removeButtonLabel:string { "Remove item(s)" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - optionsWindow:table - { - windowTitle:string { "Options" } - - needToRestartMsg:string { "You will need to restart the " - "application\nfor the new settings " - "to take effect." } - errorMsg:string { "Could not save the options: " } - - soundSectionLabel:string { "Sound" } - keyBindingsSectionLabel:string { "Keyboard Shortcuts" } - serversSectionLabel:string { "Servers" } - schedulerSectionLabel:string { "Scheduler" } - backupSectionLabel:string { "Backup" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "About" } - - cancelButtonLabel:string { "Cancel" } - applyButtonLabel:string { "Apply" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Cue audio device:" } - outputDeviceLabel:string { "Live Mode audio device:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Press a key..." } - keyBindingsInstructionsText:string - { "Double-click on the shortcut you want " - "to change, \n" - "then press the key for the new " - "shortcut\n" - "(or press the Escape key to cancel " - "the operation)." } - - authenticationLabel:string { "Authentication server" } - storageLabel:string { "Storage server" } - schedulerLabel:string { "Scheduler server" } - serverLabel:string { "address:" } - portLabel:string { "port:" } - pathLabel:string { "path:" } - - schedulerStatusText:string { "The scheduler is" } - schedulerRunningStatus:string { "running." } - schedulerStoppedStatus:string { "stopped." } - schedulerStartButtonLabel:string { "Start" } - schedulerStopButtonLabel:string { "Stop" } - - reportBugsToText:string { "Report bugs to: {0}" } - } - - backupView:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - mtimeTextLabel:string { "#Modified since:#" } - chooseTimeButtonLabel:string { "#Choose time#" } - resetTimeButtonLabel:string { "#Reset#" } - - backupButtonLabel:string { "#Backup#" } - deleteButtonLabel:string { "#Delete#" } - saveButtonLabel:string { "#Save#" } - - backupTitleLabel:string { "#Title:#" } - defaultBackupTitle:string { "#new backup#" } - - fileChooserDialogTitle:string { "#Save File#" } - backupErrorMsg:string { "#Backup error: #" } - } - - rdsView:table - { - deviceLabel:string { "#Serial port:#" } - PSrdsLabel:string { "#Station name:#" } - PIrdsLabel:string { "#Station code:#" } - RTrdsLabel:string { "#Clip info:#" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Select the date and time" } - - cancelButtonLabel:string { "Cancel" } - okButtonLabel:string { "OK" } - - hourLabel:string { "hour:" } - minuteLabel:string { "minute:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Export Playlist" } - - playlistTitleLabel:string { "Title:" } - formatLabel:string { "Export as:" } - - cancelButtonLabel:string { "Cancel" } - saveButtonLabel:string { "Save" } - - internalFormatName:string { "Campcaster archive" } - smilFormatName:string { "tar containing a SMIL" } - - fileChooserDialogTitle:string { "Save File" } - - createExportErrorMsg:string { "Could not export the playlist:" } - saveExportErrorMsg:string { "Could not save the exported playlist." } - } - - transportList:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - cancelUploadMenuItem:string { "#Cancel upload#" } - cancelDownloadMenuItem:string { "#Cancel download#" } - - cannotCancelTransportMsg:string { "#Canceling failed: {0}.#" } - duplicateFileMsg:string { "#the file is in the network " - "hub already.#" } - } - - restoreBackupWindow:table - { - windowTitle:string { "Restore Backup" } - errorMessage:string { "Error: {0}" } - pendingMessage:string { "Uploading backup file\n''{0}''.\n" - "Please wait..." } - finishedMessage:string { "Upload finished." } - } - - metadataTypes:table - { - title:string { "Título" } - creator:string { "Creador" } - album:string { "Álbum" } - year:string { "Año" } - genre:string { "Género" } - description:string { "Descripción" } - format:string { "Formato" } - length:string { "Duración" } - bpm:string { "BPM" } - rating:string { "Calificación" } - encoded_by:string { "Codificador por" } - track_number:string { "Pista número" } - disc_number:string { "Disco número" } - mood:string { "Clasificación" } - publishing_label:string { "Disquera" } - composer:string { "Compositor" } - bitrate:string { "Tasa de bits" } - channels:string { "Canales" } - sample_rate:string { "Tasa de muestra" } - encoding_software:string { "Programa para codificación" } - checksum:string { "Suma de comprobación" } - lyrics:string { "Letras" } - orchestra_or_band:string { "Orquesta o grupo musical" } - conductor:string { "Conductor" } - lyricist:string { "Autor de la letra" } - original_lyricist:string { "Autor original" } - radio_station_name:string { "Nombre de la estación de radio" } - audio_file_info_url:string { "Sitio web con información del archivo" } - artist_url:string { "Sitio web del artista" } - audio_source_url:string { "Sitio web de la fuente" } - radio_station_url:string { "Sitio web de la estación de radio" } - buy_cd_url:string { "Sitio web para comprar CD" } - isrc_number:string { "número ISRC" } - catalog_number:string { "número de catálogo" } - original_artist:string { "Artista original" } - copyright:string { "Derechos Reservados" } - report_date_time:string { "Report date/time" } - report_location:string { "Report location" } - report_organizations:string { "Report organizations" } - subject:string { "Subject" } - } - - keyboardShortcuts:table - { - playAudio:string { "Play" } - pauseAudio:string { "Pause" } - stopAudio:string { "Stop" } - nextTrack:string { "Next track" } - fadeOut:string { "Fade out" } - moveItemUp:string { "Move item up" } - moveItemDown:string { "Move item down" } - removeItem:string { "Remove item" } - } -} diff --git a/src/products/gLiveSupport/var/fr.txt b/src/products/gLiveSupport/var/fr.txt deleted file mode 100644 index 9e3cb61ee..000000000 --- a/src/products/gLiveSupport/var/fr.txt +++ /dev/null @@ -1,467 +0,0 @@ -fr:table -{ - cancelButtonLabel:string { "Annuler" } - noButtonLabel:string { "Non" } - yesButtonLabel:string { "Oui" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Locale {0} n'est pas disponible." } - schedulerNotReachableMsg:string { "Le serveur de programmation est inaccessible." } - storageNotReachableMsg:string { "Le serveur de stockage est inaccessible." } - authenticationNotReachableMsg:string - { "Le serveur d'authentification est " - "inaccessible.\n" - "Voulez vous éditer les paramètres " - "du serveur?" } - audioErrorMsg { "Erreur Lecteur Audio: " } - - masterPanelWindow:table - { - windowTitle:string { "Fenêtre Principale" } - - notLoggedInMsg:string { "Pas connecté" } - loggedInMsg:string { "Utilisateur: {0}" } - loginButtonLabel:string { "Connexion" } - logoutButtonLabel:string { "Déconnexion" } - liveModeButtonLabel:string { "Mode Live" } - uploadFileButtonLabel:string { "Transfert" } - scratchpadButtonLabel:string { "Console" } - playlistButtonLabel:string { "Sélection" } - schedulerButtonLabel:string { "Planificateur" } - searchButtonLabel:string { "Recherche" } - optionsButtonLabel:string { "Options" } - - elapsedTimeLabel:string { "écoulé" } - remainingTimeLabel:string { "restant" } - - sureToExitMsg:string { "Etes vous sûr de vouloir quitter?" } - } - - loginWindow:table - { - windowTitle:string { "Connexion" } - - userNameLabel:string { "Nom d'utilisateur" } - passwordLabel:string { "Mot de passe" } - languageLabel:string { "Langue" } - - pleaseWaitMsg:string { "Connexion en cours, veuillez patienter." } - } - - audioClipListWindow:table - { - windowTitle:string { "Liste des Clips Audio" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "durée" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "jeton" } - - closeButtonLabel:string { "Fermer" } - } - - scratchpadWindow:table - { - windowTitle:string { "Console de mixage" } - - creatorColumnLabel:string { "Auteur" } - titleColumnLabel:string { "Titre" } - addToPlaylistButtonLabel:string { "Ajouter à la sélection" } - clearListButtonLabel:string { "Effacer la liste" } - removeButtonLabel:string { "Supprimer" } - - cueMenuItem:string { "Ape_rçu" } - addToLiveModeMenuItem:string { "Ajouter au _Mode Live " } - addToPlaylistMenuItem:string { "_Ajouter à la sélection" } - removeMenuItem:string { "_Supprimer" } - editPlaylistMenuItem:string { "_Editer la sélection" } - schedulePlaylistMenuItem:string { "_Programmer la sélection" } - exportPlaylistMenuItem:string { "E_xporter la sélection" } - uploadToHubMenuItem:string { "Transférer vers le Network Hub" } - - cannotEditPlaylistMsg:string - { "Ne peut ouvrir la sélection pour modification." } - } - - playlistListWindow:table - { - windowTitle:string { "Sélection" } - - listBoxLabel { "Sélections" } - detailBoxLabel { "Détails" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "durée" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "jeton" } - - closeButtonLabel:string { "Fermer" } - } - - uploadFileWindow:table - { - windowTitle:string { "Transfert de fichiers" } - - chooseFileLabel:string { "Nom de fichier" } - chooseFileButtonLabel:string { "Parcourir" } - - mainSectionLabel:string { "Principal" } - musicSectionLabel:string { "Musique" } - voiceSectionLabel:string { "Voix" } - - lengthLabel:string { "Durée" } - - uploadButtonLabel:string { "Transfert" } - closeButtonLabel:string { "Annuler" } - - fileChooserDialogTitle:string { "Ouvrir Fichier" } - fileUploadedMsg:string { "''{0}'' transféré." } - couldNotOpenFileMsg:string { "Le fichier ne peut être ouvert." } - couldNotReadLengthMsg:string { "Ne peut déterminer la durée du" - "clip audio." } - unsupportedFileTypeMsg:string { "Type de fichier non pris en charge." } - missingTitleMsg:string { "Veuillez entrer un titre." } - badMetadataMsg:string { "Métadonnées invalides pour {0}." } - duplicateFileMsg:string { "Erreur: le fichier a déjà été " - "stocké." } - } - - playlistWindow:table - { - windowTitle:string { "Editer la sélection" } - - startColumnLabel:string { "Lire" } - titleColumnLabel:string { "Titre" } - lengthColumnLabel:string { "durée" } - fadeInColumnLabel:string { "Fade in" } - fadeOutColumnLabel:string { "Fade out" } - - nameLabel:string { "Nom" } - lengthLabel:string { "Durée:" } - saveButtonLabel:string { "Enregistrer" } - closeButtonLabel:string { "Fermer" } - lockFadesCheckButtonLabel:string - { "Verrouiller la fin sur le début en fondu (non stop)" } - - upMenuItem:string { "_Haut" } - downMenuItem:string { "_Bas" } - removeMenuItem:string { "_Supprimer" } - - playlistSavedMsg:string { "Enregistrer la sélection ''{0}''." } - savePlaylistDialogMsg:string { "Voulez-vous enregistrer la sélection?" } - closeWithoutSavingButtonLabel:string - { "Fermer sans sauvergarder" } - emptyTitleErrorMsg:string { "Veuillez entrer un titre." } - } - - schedulerWindow:table - { - windowTitle:string { "Planificateur" } - - scheduleTab:string { "Programme" } - statusTab:string { "Etat" } - - startColumnLabel:string { "Lire" } - titleColumnLabel:string { "titre" } - endColumnLabel:string { "fin" } - deleteMenuItem:string { "_Supprimer" } - - stopCurrentlyPlayingButtonLabel:string { "Arrêter" } - stopCurrentlyPlayingText:string { "la lecture en cours" - "dans le planificateur." } - stopCurrentlyPlayingDialogMsg:string { "En êtes vous sûr?" } - - closeButtonLabel:string { "Fermer" } - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Programmer la sélection" } - - hourLabel:string { "heure: " } - minuteLabel:string { "minute: " } - secondLabel:string { "secondes: " } - scheduleButtonLabel:string { "programmer" } - closeButtonLabel:string { "Fermer" } - } - - searchWindow:table - { - windowTitle:string { "Recherche/Parcourir" } - - searchWhereLabel:string { "Rechercher ou parcourir: " } - searchWhereLocal:string { "archive locale" } - searchWhereRemote:string { "archive distante" } - - simpleSearchTab:string { "Recherche" } - advancedSearchTab:string { "Recherche Avancée" } - browseTab:string { "Parcourir" } - transportsTab:string { "Transfers" } - - searchButtonLabel:string { "Recherche" } - backwardButtonLabel:string { "⇦ Précédent" } - forwardButtonLabel:string { "Suivant ⇨" } - searchResultsCountLabel:string { "{0}-{1} of {2} résultats" } - - typeColumnLabel:string { "Type" } - titleColumnLabel:string { "Titre" } - creatorColumnLabel:string { "Auteur" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Durée" } - - allStringForBrowse { "--- tout ---" } - - addToScratchpadMenuItem:string { "Ajouter à la _Console de Mixage" } - addToPlaylistMenuItem:string { "_Ajouter à la sélection" } - addToLiveModeMenuItem:string { "Ajouter au Mode _Live " } - editPlaylistMenuItem:string { "_Editer la sélection" } - schedulePlaylistMenuItem:string { "_Programmer la sélection" } - exportPlaylistMenuItem:string { "E_xporter la sélection" } - uploadToHubMenuItem:string { "Transférer vers l'archive distante" } - downloadFromHubMenuItem:string { "Télécharger à partir de l'archive distante" } - - pleaseWaitMsg:string { "Veuillez patienter..." } - shortErrorMsg:string { "Echec de la recherche." } - longErrorMsg:string { "Echec de la recherche: {0}." } - uploadToHubErrorMsg:string { "Echec du transfert vers l'archive distante: {0}." } - downloadFromHubErrorMsg:string { "Echec du téléchargement à partir de l'archive distante: {0}." } - nothingFoundMsg:string { "Fichiers introuvables." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "Types de fichier" } - allFileType:string { "tout" } - audioClipFileType:string { "clips audio" } - playlistFileType:string { "sélections" } - - searchByTextLabel:string { "Recherche par" } - - partialOperatorDisplay:string { "contient" } - prefixOperatorDisplay:string { "commence par" } - =OperatorDisplay:string { "égal" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Mode Live" } - - playMenuItem:string { "_Lire" } - cueMenuItem:string { "Ape_rçu" } - addToPlaylistMenuItem:string { "_Ajouter à la sélection" } - removeMenuItem:string { "_Supprimer" } - editPlaylistMenuItem:string { "_Editer la sélection" } - schedulePlaylistMenuItem:string { "_Programmer la sélection" } - exportPlaylistMenuItem:string { "E_xporter la sélection" } - uploadToHubMenuItem:string { "Transférer vers l'\archive distante" } - - cuePlayerLabel:string { "Aperçu" } - autoPlayNextLabel:string { "Lire automatiquement le morceau suivant" } - - clearListButtonLabel:string { "Effacer la liste" } - removeButtonLabel:string { "Supprimer" } - - cannotEditPlaylistMsg:string - { "Ne peut ouvrir la sélection pour modification." } - } - - optionsWindow:table - { - windowTitle:string { "Options" } - - needToRestartMsg:string { "Vous devez redémarrer " - "l'application\npour que les nouveaux paramètres " - "soient effectifs." } - errorMsg:string { "Ne peut sauvegarder les options: " } - - soundSectionLabel:string { "Son" } - keyBindingsSectionLabel:string { "Raccourcis clavier" } - serversSectionLabel:string { "Serveurs" } - schedulerSectionLabel:string { "Planificateur" } - backupSectionLabel:string { "Sauvegarde" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "A propos" } - - cancelButtonLabel:string { "Annuler" } - applyButtonLabel:string { "Appliquer" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Périphérique audio 'Cue':" } - outputDeviceLabel:string { "Périphérique audio Mode Live:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Appuyer sur une touche..." } - keyBindingsInstructionsText:string - { "Double-cliquer le raccourci que vous voulez " - "modifier, \n" - "puis appuyer sur la touche du nouveau " - "raccourci\n" - "(ou appuyer la touche Echap pour annuler " - "l'opération)." } - - authenticationLabel:string { "Serveur d'authentification" } - storageLabel:string { "Serveur de stockage" } - schedulerLabel:string { "Serveur de programmation" } - serverLabel:string { "adresse:" } - portLabel:string { "port:" } - pathLabel:string { "chemin:" } - - schedulerStatusText:string { "Le Planificateur est" } - schedulerRunningStatus:string { "en cours d'exécution." } - schedulerStoppedStatus:string { "arrêter." } - schedulerStartButtonLabel:string { "Démarrer" } - schedulerStopButtonLabel:string { "Arrêter" } - - reportBugsToText:string { "Rapporter les bugs à: {0}" } - creditsText:import { "../../../../CREDITS" } - } - - backupView:table - { - workingStatus:string { "En cours..." } - successStatus:string { "Prêt" } - faultStatus:string { "Erreur: {0}" } - - titleColumnLabel:string { "Titre" } - dateColumnLabel:string { "Date" } - statusColumnLabel:string { "Etat" } - - mtimeTextLabel:string { "Modifié depuis:" } - chooseTimeButtonLabel:string { "Choisir le moment" } - resetTimeButtonLabel:string { "Réinitialiser" } - - backupButtonLabel:string { "Sauvegarde" } - deleteButtonLabel:string { "Supprimer" } - saveButtonLabel:string { "Enregistrer" } - - backupTitleLabel:string { "Titre:" } - defaultBackupTitle:string { "nouvelle sauvegarde" } - - fileChooserDialogTitle:string { "Enregister le fichier" } - backupErrorMsg:string { "Erreur de sauvegarde: " } - } - - rdsView:table - { - deviceLabel:string { "Port série:" } - PSrdsLabel:string { "Nom de la station:" } - PIrdsLabel:string { "Code de la station:" } - RTrdsLabel:string { "Infos clip:" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Choisir la date et l'heure" } - - cancelButtonLabel:string { "Annuler" } - okButtonLabel:string { "OK" } - - hourLabel:string { "heure:" } - minuteLabel:string { "minute:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Exporter la sélection" } - - playlistTitleLabel:string { "Titre:" } - formatLabel:string { "Exporter sous:" } - - cancelButtonLabel:string { "Annuler" } - saveButtonLabel:string { "Enregistrer" } - - internalFormatName:string { "Archive Campcaster " } - smilFormatName:string { "tar contenant du SMIL" } - - fileChooserDialogTitle:string { "Enregistrer le Fichier" } - - createExportErrorMsg:string { "Ne peut exporter la sélection:" } - saveExportErrorMsg:string { "Ne peut enregistrer la sélection exportée." } - } - - transportList:table - { - workingStatus:string { "En cours..." } - successStatus:string { "Prêt" } - faultStatus:string { "Erreur: {0}" } - - titleColumnLabel:string { "Titre" } - dateColumnLabel:string { "Date" } - statusColumnLabel:string { "Etat" } - - cancelUploadMenuItem:string { "Annuler le transfert" } - cancelDownloadMenuItem:string { "Annuler le télechargement" } - - cannotCancelTransportMsg:string { "Echec de l'annulation: {0}." } - duplicateFileMsg:string { "le fichier existe déjà sur " - "l'archive distante." } - } - - restoreBackupWindow:table - { - windowTitle:string { "Restaurer la sauvegarde" } - errorMessage:string { "Erreur: {0}" } - pendingMessage:string { "Transfert du fichier de sauvegarde\n''{0}''.\n" - "Veuillez patienter..." } - finishedMessage:string { "Transfert terminé." } - } - - metadataTypes:table - { - title:string { "Titre" } - creator:string { "Auteur" } - album:string { "Album" } - year:string { "Année" } - genre:string { "Genre" } - description:string { "Description" } - format:string { "Format" } - length:string { "Durée" } - bpm:string { "BPM" } - rating:string { "Classement" } - encoded_by:string { "Encodé par" } - track_number:string { "Numéro de piste" } - disc_number:string { "Numéro de disque" } - mood:string { "Mode" } - publishing_label:string { "Etiquette de publication" } - composer:string { "Compositeur" } - bitrate:string { "Vitesse de transmission" } - channels:string { "Canaux" } - sample_rate:string { "Jeu de classement" } - encoding_software:string { "Logiciel d'encodage" } - checksum:string { "Checksum" } - lyrics:string { "Paroles" } - orchestra_or_band:string { "Orchestre ou groupe" } - conductor:string { "Chef d'orchestre" } - lyricist:string { "Paroles" } - original_lyricist:string { "Paroles originales" } - radio_station_name:string { "Nom de la station radio" } - audio_file_info_url:string { "Page web du fichier audio" } - artist_url:string { "Page web de l'artiste" } - audio_source_url:string { "Page web de la source audio" } - radio_station_url:string { "Page web de la station radio" } - buy_cd_url:string { "Page web pour acheter le CD" } - isrc_number:string { "Numéro ISRC" } - catalog_number:string { "Numéro Catalogue" } - original_artist:string { "Artiste original" } - copyright:string { "Copyright" } - report_date_time:string { "Date/heure du rapport" } - report_location:string { "Emplacement du rapport" } - report_organizations:string { "Organisations" } - subject:string { "Sujet" } - } - - keyboardShortcuts:table - { - playAudio:string { "Lire" } - pauseAudio:string { "Suspendre" } - stopAudio:string { "Arrêt" } - nextTrack:string { "Piste suivante" } - fadeOut:string { "Terminer en fondu" } - moveItemUp:string { "Haut" } - moveItemDown:string { "Bas" } - removeItem:string { "Supprimer" } - } -} - diff --git a/src/products/gLiveSupport/var/glade/DateTimeChooserWindow.glade b/src/products/gLiveSupport/var/glade/DateTimeChooserWindow.glade deleted file mode 100644 index 4aa435e42..000000000 --- a/src/products/gLiveSupport/var/glade/DateTimeChooserWindow.glade +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - hours: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 23 1 10 0 - - - False - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - minutes: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 59 1 10 0 - - - False - False - 1 - - - - - False - False - 1 - - - - - False - False - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - -5 - - - False - False - - - - - False - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/ExportPlaylistWindow.glade b/src/products/gLiveSupport/var/glade/ExportPlaylistWindow.glade deleted file mode 100644 index fec84e5f0..000000000 --- a/src/products/gLiveSupport/var/glade/ExportPlaylistWindow.glade +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - title: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - my playlist - - - False - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - export as: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - internal format - True - True - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - SMIL format - True - internalFormatRadioButton1 - - - False - False - 1 - - - - - False - 1 - - - - - False - False - 1 - - - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - -6 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-save - True - -10 - - - 1 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/GLiveSupport.glade b/src/products/gLiveSupport/var/glade/GLiveSupport.glade deleted file mode 100644 index 2c0617068..000000000 --- a/src/products/gLiveSupport/var/glade/GLiveSupport.glade +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - False - True - GTK_WIN_POS_CENTER_ALWAYS - . - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - gtk-dialog-warning - 6 - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - are you sure? - True - True - True - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-no - True - -9 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-yes - True - -8 - - - 1 - - - - - False - GTK_PACK_END - - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - False - True - GTK_WIN_POS_CENTER_ALWAYS - . - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - gtk-dialog-warning - 6 - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - some error occurred! - True - True - True - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - -5 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/LiveModeWindow.glade b/src/products/gLiveSupport/var/glade/LiveModeWindow.glade deleted file mode 100644 index f919a89b3..000000000 --- a/src/products/gLiveSupport/var/glade/LiveModeWindow.glade +++ /dev/null @@ -1,142 +0,0 @@ - - - - - - 400 - 500 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 80 - 80 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-play - True - False - GTK_POS_TOP - - - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - preview - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - True - - - 80 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-play - True - - - - - 80 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-stop - True - - - 1 - - - - - False - 1 - - - - - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - play next item automatically - True - - - - - False - False - 1 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - True - 1 - - - - - 2 - - - - - - diff --git a/src/products/gLiveSupport/var/glade/LoginWindow.glade b/src/products/gLiveSupport/var/glade/LoginWindow.glade deleted file mode 100644 index 766f6b7c3..000000000 --- a/src/products/gLiveSupport/var/glade/LoginWindow.glade +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - False - True - GTK_WIN_POS_CENTER_ALWAYS - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - user name - - - False - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - password - - - False - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - - - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - language - - - False - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - - 1 - - - - - 2 - - - - - False - 50 - - - - - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - statusBar - - - - - False - 2 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - -6 - - - - - True - True - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - -5 - - - 1 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade b/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade deleted file mode 100644 index c95d87e0c..000000000 --- a/src/products/gLiveSupport/var/glade/MasterPanelWindow.glade +++ /dev/null @@ -1,434 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - Campcaster Studio - masterPanelWindow - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_IN - - - 160 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - time - - - - - - label_item - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - 80 - True - False - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-play - True - GTK_POS_TOP - - - False - False - - - - - 80 - True - False - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-stop - True - GTK_POS_TOP - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - GTK_SHADOW_IN - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - 3 - title - PANGO_ELLIPSIZE_END - True - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - creator - PANGO_ELLIPSIZE_END - True - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 322 - 8 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - False - False - - - - - 2 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 10 - - - 200 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - elapsed: - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - elapsed time - - - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - remains: - - - False - False - 5 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - remaining time - - - - - False - False - 5 - - - - - 1 - - - - - False - False - 1 - - - - - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - playlist - PANGO_ELLIPSIZE_MIDDLE - True - - - 4 - - - - - - - - label_item - - - - - 2 - - - - - 1 - - - - - 120 - 104 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-missing-image - - - False - False - 2 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - live mode - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - upload file - - - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - scratchpad - - - 2 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - playlist - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - scheduler - - - 4 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - search - - - 5 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - options - - - 6 - - - - - False - False - 5 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 5 - user logged in - GTK_JUSTIFY_RIGHT - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - log in - - - False - False - 1 - - - - - 1 - - - - - False - False - 1 - - - - - - diff --git a/src/products/gLiveSupport/var/glade/OptionsWindow.glade b/src/products/gLiveSupport/var/glade/OptionsWindow.glade deleted file mode 100644 index 63bcb6cc9..000000000 --- a/src/products/gLiveSupport/var/glade/OptionsWindow.glade +++ /dev/null @@ -1,1645 +0,0 @@ - - - - - - 710 - 575 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GDK_WINDOW_TYPE_HINT_NORMAL - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 200 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - cue device: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 100 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - test - - - False - 2 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 200 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - output device: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 100 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - test - - - False - 2 - - - - - False - False - 1 - - - - - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - sound - - - tab - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - click on the shortcut you want to change, -and then do some other stuff - GTK_JUSTIFY_CENTER - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - False - - - 1 - - - - - - - - - 1 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - keyboard shortcuts - - - tab - 1 - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - authentication server - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - location: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - port: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - path: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 2 - - - - - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - storage server - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - location: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - port: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - path: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 2 - - - - - 1 - - - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - scheduler server - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - location: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - port: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 100 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - path: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - 2 - - - - - 1 - - - - - False - False - 2 - - - - - - - - - 2 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - servers - - - tab - 2 - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 16 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 7 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - the scheduler is - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - running - - - False - False - 1 - - - - - False - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_SPREAD - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - stop - - - 1 - - - - - False - False - 1 - - - - - 3 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - scheduler - - - tab - 3 - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - title: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - modified since: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - 20 - False - 0.5 - - - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - choose time - - - 2 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - reset - - - 3 - - - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - file type: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-add - True - - - False - False - 4 - - - - - False - False - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 1 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 2 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 3 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 4 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 100 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - backup - - - False - False - GTK_PACK_END - - - - - False - False - 2 - - - - - 2 - - - - - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - False - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-save - True - - - 1 - - - - - False - False - 1 - - - - - 1 - - - - - 4 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - backup - - - tab - 4 - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - serial port: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - station name (PS): - True - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - station ID (PI): - True - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 2 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - clip info (RT): - True - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 3 - - - - - 5 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - rds - - - tab - 5 - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Credits: - - XY - ZW - - -Report bugs to: - - someone@somewhere.com - - - 50 - - - - - - - - - - - 6 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - about - - - tab - 6 - False - False - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-apply - True - -10 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - -6 - - - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - -5 - - - 2 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/PlaylistWindow.glade b/src/products/gLiveSupport/var/glade/PlaylistWindow.glade deleted file mode 100644 index 78d996e0f..000000000 --- a/src/products/gLiveSupport/var/glade/PlaylistWindow.glade +++ /dev/null @@ -1,284 +0,0 @@ - - - - - - 300 - 400 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GDK_WINDOW_TYPE_HINT_NORMAL - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - name: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - Duration: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 00:00:00 - - - False - False - 1 - - - - - False - False - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - lock fade-out to following fade-in - True - True - - - False - False - 3 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - status bar - - - False - False - 4 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-close - True - -7 - - - - - True - False - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-save - True - -10 - - - 1 - - - - - False - GTK_PACK_END - - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - False - True - GTK_WIN_POS_CENTER_ALWAYS - . - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - gtk-dialog-warning - 6 - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - are you sure? - True - True - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - close without saving - -9 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - -6 - - - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-save - True - -8 - - - 2 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/RestoreBackupWindow.glade b/src/products/gLiveSupport/var/glade/RestoreBackupWindow.glade deleted file mode 100644 index d07df13d0..000000000 --- a/src/products/gLiveSupport/var/glade/RestoreBackupWindow.glade +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GTK_WIN_POS_CENTER_ALWAYS - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - uploading backup file -please wait... - GTK_JUSTIFY_CENTER - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - -6 - - - - - True - False - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-ok - True - -5 - - - 1 - - - - - False - False - 1 - - - - - - diff --git a/src/products/gLiveSupport/var/glade/SchedulePlaylistWindow.glade b/src/products/gLiveSupport/var/glade/SchedulePlaylistWindow.glade deleted file mode 100644 index c8b3629ac..000000000 --- a/src/products/gLiveSupport/var/glade/SchedulePlaylistWindow.glade +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GTK_WIN_POS_CENTER_ON_PARENT - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - my playlist - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - hours: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 23 1 10 0 - - - False - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - minutes: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 59 1 10 0 - - - False - False - 1 - - - - - False - False - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - seconds: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 0 59 1 10 0 - - - False - False - 1 - - - - - False - False - 2 - - - - - False - False - 2 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - schedule - -10 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/SchedulerWindow.glade b/src/products/gLiveSupport/var/glade/SchedulerWindow.glade deleted file mode 100644 index c20b38c0d..000000000 --- a/src/products/gLiveSupport/var/glade/SchedulerWindow.glade +++ /dev/null @@ -1,259 +0,0 @@ - - - - - - 350 - 400 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GDK_WINDOW_TYPE_HINT_NORMAL - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 3 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 2007 - 6 - 2 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 Jan 2007 - - - False - False - 1 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - - - 2 - - - - - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - schedule - - - tab - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-stop - True - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - currently playing item in scheduler - - - False - False - 1 - - - - - False - False - - - - - 1 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - status - - - tab - 1 - False - False - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-close - True - -7 - - - - - False - GTK_PACK_END - - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - False - True - GTK_WIN_POS_CENTER_ALWAYS - . - GDK_WINDOW_TYPE_HINT_DIALOG - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - gtk-dialog-warning - 6 - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - are you sure? - True - True - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-no - True - -9 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-yes - True - -8 - - - 1 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/glade/ScratchpadWindow.glade b/src/products/gLiveSupport/var/glade/ScratchpadWindow.glade deleted file mode 100644 index a708dd5eb..000000000 --- a/src/products/gLiveSupport/var/glade/ScratchpadWindow.glade +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - True - - - 80 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-play - True - - - False - False - - - - - 80 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-media-stop - True - - - False - False - 1 - - - - - False - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - 350 - 350 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - True - 2 - False - - - - - - - 1 - - - - - - diff --git a/src/products/gLiveSupport/var/glade/SearchWindow.glade b/src/products/gLiveSupport/var/glade/SearchWindow.glade deleted file mode 100644 index dcacb7d56..000000000 --- a/src/products/gLiveSupport/var/glade/SearchWindow.glade +++ /dev/null @@ -1,855 +0,0 @@ - - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - 766 - 231 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - search or browse on: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - 0 - 0.5 - 0 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - - - 100 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - search - - - False - False - 1 - - - - - - - False - False - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - search - - - tab - False - False - - - - - 280 - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - file type: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - 1 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-add - True - - - False - False - 4 - - - - - False - False - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 1 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 2 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 3 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 80 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - search by: - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 2 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 3 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-remove - True - - - False - False - 4 - - - - - False - False - 4 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 100 - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - search - - - False - False - GTK_PACK_END - - - - - False - False - 2 - - - - - - - - - 1 - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - advanced search - - - tab - 1 - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - False - - - - - 1 - - - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - False - - - - - 1 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - False - - - - - 1 - - - - - 2 - - - - - 2 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - browse - - - tab - 2 - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - False - False - - - 3 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - transports - - - tab - 3 - False - False - - - - - - - 1 - - - - - False - - - - - 766 - 343 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 1 - 25 of 32 results - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_START - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-go-back - True - - - False - False - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-go-forward - True - GTK_POS_RIGHT - - - False - False - 1 - - - - - 1 - - - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - True - GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - True - - - - - 1 - - - - - 1 - - - - - - diff --git a/src/products/gLiveSupport/var/glade/UploadFileWindow.glade b/src/products/gLiveSupport/var/glade/UploadFileWindow.glade deleted file mode 100644 index 627e74300..000000000 --- a/src/products/gLiveSupport/var/glade/UploadFileWindow.glade +++ /dev/null @@ -1,1697 +0,0 @@ - - - - - - 380 - 500 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - GDK_WINDOW_TYPE_HINT_NORMAL - False - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - file name: - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - browse - - - False - 2 - - - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 8 - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 1 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 2 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 3 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 4 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 5 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 6 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 7 - - - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - duration - - - False - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - 00:00:00 - - - 1 - - - - - False - False - 1 - - - - - - - - - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - main - - - tab - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 3 - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 1 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 2 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 3 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 4 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 5 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 6 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 7 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 8 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 9 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 10 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 11 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 12 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 13 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 14 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 15 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 16 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 17 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 18 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 19 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 20 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 21 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 22 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 23 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 24 - - - - - - - - - 1 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - music - - - tab - 1 - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_RESIZE_QUEUE - GTK_SHADOW_NONE - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 3 - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 1 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 2 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 3 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 4 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 5 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 6 - - - - - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - - - 150 - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - metadata - - - False - False - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - - - - - False - False - 7 - - - - - - - - - 2 - False - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - voice - - - tab - 2 - False - False - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - status bar - - - False - False - 2 - - - - - 1 - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - GTK_BUTTONBOX_END - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-cancel - True - -6 - - - - - True - True - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-apply - True - -10 - - - 1 - - - - - False - GTK_PACK_END - - - - - - diff --git a/src/products/gLiveSupport/var/hu.txt b/src/products/gLiveSupport/var/hu.txt deleted file mode 100644 index eb54d2a28..000000000 --- a/src/products/gLiveSupport/var/hu.txt +++ /dev/null @@ -1,464 +0,0 @@ -hu:table -{ - cancelButtonLabel:string { "Mégsem" } - noButtonLabel:string { "Nem" } - yesButtonLabel:string { "Igen" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "A {0} nyelv nem elérhető" } - schedulerNotReachableMsg:string { "Az időzítő szerver nem elérhető" } - storageNotReachableMsg:string { "A tároló szerver nem elérhető" } - authenticationNotReachableMsg:string - { "A beléptető szerver nem elérhető.\n" - "Szerver beállítások szerkesztése?" } - audioErrorMsg { "Hiba történt a lejátszáskor: " } - - masterPanelWindow:table - { - windowTitle:string { "Fő Panel" } - - notLoggedInMsg:string { "Nincs bejelentkezve" } - loggedInMsg:string { "Bejelentkezve: {0}" } - loginButtonLabel:string { "Log in" } - logoutButtonLabel:string { "Log out" } - liveModeButtonLabel:string { "Élő adás" } - uploadFileButtonLabel:string { "Filefeltöltés" } - scratchpadButtonLabel:string { "Scratchpad" } - playlistButtonLabel:string { "Műsorkezelés" } - schedulerButtonLabel:string { "Időzítő" } - searchButtonLabel:string { "Keresés" } - optionsButtonLabel:string { "Beállítások" } - - elapsedTimeLabel:string { "eltelt" } - remainingTimeLabel:string { "hátralevő" } - - sureToExitMsg:string { "Biztos, hogy ki szeretne lépni?" } - } - - loginWindow:table - { - windowTitle:string { "Belépés" } - - userNameLabel:string { "Azonosító" } - passwordLabel:string { "Jelszó" } - languageLabel:string { "Nyelv" } - - pleaseWaitMsg:string { "Kérem, várjon..." } - } - - audioClipListWindow:table - { - windowTitle:string { "Hanganyag" } - - idColumnLabel:string { "azonosító" } - lengthColumnLabel:string { "hossz" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "bezár" } - } - - scratchpadWindow:table - { - windowTitle:string { "Scratchpad" } - - creatorColumnLabel:string { "Előadó" } - titleColumnLabel:string { "Cím" } - addToPlaylistButtonLabel:string { "Műsorhoz hozzáadni" } - clearListButtonLabel:string { "Lista törlése" } - removeButtonLabel:string { "Kiválasztottak törlése" } - - cueMenuItem:string { "_Belehallgatni" } - addToLiveModeMenuItem:string { "Élő _adásba" } - addToPlaylistMenuItem:string { "Műsorhoz _hozzáadni" } - removeMenuItem:string { "_Törölni" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Műsor időzítése" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - playlistListWindow:table - { - windowTitle:string { "Műsorszerkesztő" } - - listBoxLabel { "Műsorok" } - detailBoxLabel { "Műsor adatai" } - - idColumnLabel:string { "azonosító" } - lengthColumnLabel:string { "hossz" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "Bezár" } - } - - uploadFileWindow:table - { - windowTitle:string { "Filefeltöltés" } - - chooseFileLabel:string { "Filenév" } - chooseFileButtonLabel:string { "Tallóz" } - - mainSectionLabel:string { "Általános" } - musicSectionLabel:string { "Music" } - voiceSectionLabel:string { "Voice" } - - lengthLabel:string { "Hossz" } - - uploadButtonLabel:string { "feltölt" } - closeButtonLabel:string { "bezár" } - - fileChooserDialogTitle:string { "File Kiválasztása" } - fileUploadedMsg:string { "A ''{0}'' file feltöltve." } - couldNotOpenFileMsg:string { "A fájl nem olvasható." } - couldNotReadLengthMsg:string { "#Could not determine audio clip " - "length.#" } - unsupportedFileTypeMsg:string { "#Unsupported file type.#" } - missingTitleMsg:string { "Kérem, adjon meg egy címet." } - badMetadataMsg:string { "#Invalid data for {0}.#" } - duplicateFileMsg:string { "#Error: the file is in the storage " - "already.#" } - } - - playlistWindow:table - { - windowTitle:string { "Műsorszerkesztő" } - - startColumnLabel:string { "kezdet" } - titleColumnLabel:string { "cím" } - lengthColumnLabel:string { "hossz" } - fadeInColumnLabel:string { "Fade in" } - fadeOutColumnLabel:string { "Fade out" } - - nameLabel:string { "név" } - lengthLabel:string { "Duration:" } - saveButtonLabel:string { "elment" } - closeButtonLabel:string { "bezár" } - lockFadesCheckButtonLabel:string - { "Lock fade-out to following fade-in" } - - upMenuItem:string { "Move _Up" } - downMenuItem:string { "Move D_own" } - removeMenuItem:string { "_Remove" } - - playlistSavedMessage:string { "a {0} műsor elmentve" } - savePlaylistDialogMsg:string { "El szeretné menteni a műsort?" } - closeWithoutSavingButtonLabel:string - { "Bezárás mentés nélkül" } - emptyTitleErrorMsg:string { "Kérem, adjon meg egy címet!" } - } - - schedulerWindow:table - { - windowTitle:string { "Időzítő" } - - scheduleTab:string { "Schedule" } - statusTab:string { "Status" } - - startColumnLabel:string { "kezdet" } - titleColumnLabel:string { "cím" } - endColumnLabel:string { "vég" } - deleteMenuItem:string { "_töröl" } - - stopCurrentlyPlayingButtonLabel:string { "Stop" } - stopCurrentlyPlayingText:string { "what is currently playing " - "in the scheduler." } - stopCurrentlyPlayingDialogMsg:string { "Are you sure?" } - - closeButtonLabel:string { "bezár" } - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Időzítő" } - - hourLabel:string { "óra: " } - minuteLabel:string { "perc: " } - secondLabel:string { "másodperc: " } - scheduleButtonLabel:string { "időzít" } - closeButtonLabel:string { "bezár" } - } - - searchWindow:table - { - windowTitle:string { "Keresés" } - - searchWhereLabel:string { "Search or browse on: " } - searchWhereLocal:string { "local storage" } - searchWhereRemote:string { "network hub" } - - simpleSearchTab:string { "Keresés" } - advancedSearchTab:string { "Összetett keresés" } - browseTab:string { "Böngészés" } - transportsTab:string { "Transfers" } - - searchButtonLabel:string { "Keress!" } - backwardButtonLabel:string { "⇦ Previous" } - forwardButtonLabel:string { "Next ⇨" } - searchResultsCountLabel:string { "{0}-{1} of {2} results" } - - typeColumnLabel:string { "Típus" } - titleColumnLabel:string { "Cím" } - creatorColumnLabel:string { "Előadó" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Hossz" } - - allStringForBrowse { "--- minden ---" } - - addToScratchpadMenuItem:string { "Scratchpadbe betenni" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - addToLiveModeMenuItem:string { "Élő _adásba" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to the network hub" } - downloadFromHubMenuItem:string { "Download from the network hub" } - - pleaseWaitMsg:string { "Please wait..." } - shortErrorMsg:string { "Search failed." } - longErrorMsg:string { "Search failed: {0}." } - uploadToHubErrorMsg:string { "Uploading to hub failed: {0}." } - downloadFromHubErrorMsg:string { "Downloading from hub failed: {0}." } - nothingFoundMsg:string { "No files found." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "File types" } - allFileType:string { "all" } - audioClipFileType:string { "audio clips" } - playlistFileType:string { "playlists" } - - searchByTextLabel:string { "Keresési feltétel:" } - - partialOperatorDisplay:string { "része" } - prefixOperatorDisplay:string { "kezdete" } - =OperatorDisplay:string { "=" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Élő adás" } - - playMenuItem:string { "Le_játszani" } - cueMenuItem:string { "_Belehallgatni" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - removeMenuItem:string { "_Eltávolítani" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cuePlayerLabel:string { "Belehallgatni" } - autoPlayNextLabel:string { "#Play the next item automatically#" } - - clearListButtonLabel:string { "Clear list" } - removeButtonLabel:string { "Remove item(s)" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - optionsWindow:table - { - windowTitle:string { "Options" } - - needToRestartMsg:string { "You will need to restart the " - "application\nfor the new settings " - "to take effect." } - errorMsg:string { "Could not save the options: " } - - soundSectionLabel:string { "Sound" } - keyBindingsSectionLabel:string { "Keyboard Shortcuts" } - serversSectionLabel:string { "Servers" } - schedulerSectionLabel:string { "Scheduler" } - backupSectionLabel:string { "Backup" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "About" } - - cancelButtonLabel:string { "Cancel" } - applyButtonLabel:string { "Apply" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Cue audio device:" } - outputDeviceLabel:string { "Live Mode audio device:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Press a key..." } - keyBindingsInstructionsText:string - { "Double-click on the shortcut you want " - "to change, \n" - "then press the key for the new " - "shortcut\n" - "(or press the Escape key to cancel " - "the operation)." } - - authenticationLabel:string { "Authentication server" } - storageLabel:string { "Storage server" } - schedulerLabel:string { "Scheduler server" } - serverLabel:string { "address:" } - portLabel:string { "port:" } - pathLabel:string { "path:" } - - schedulerStatusText:string { "The scheduler is" } - schedulerRunningStatus:string { "running." } - schedulerStoppedStatus:string { "stopped." } - schedulerStartButtonLabel:string { "Start" } - schedulerStopButtonLabel:string { "Stop" } - - reportBugsToText:string { "Report bugs to: {0}" } - } - - backupView:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - mtimeTextLabel:string { "#Modified since:#" } - chooseTimeButtonLabel:string { "#Choose time#" } - resetTimeButtonLabel:string { "#Reset#" } - - backupButtonLabel:string { "#Backup#" } - deleteButtonLabel:string { "#Delete#" } - saveButtonLabel:string { "#Save#" } - - backupTitleLabel:string { "#Title:#" } - defaultBackupTitle:string { "#new backup#" } - - fileChooserDialogTitle:string { "#Save File#" } - backupErrorMsg:string { "#Backup error: #" } - } - - rdsView:table - { - deviceLabel:string { "#Serial port:#" } - PSrdsLabel:string { "#Station name:#" } - PIrdsLabel:string { "#Station code:#" } - RTrdsLabel:string { "#Clip info:#" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Select the date and time" } - - cancelButtonLabel:string { "Cancel" } - okButtonLabel:string { "OK" } - - hourLabel:string { "hour:" } - minuteLabel:string { "minute:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Export Playlist" } - - playlistTitleLabel:string { "Title:" } - formatLabel:string { "Export as:" } - - cancelButtonLabel:string { "Cancel" } - saveButtonLabel:string { "Save" } - - internalFormatName:string { "Campcaster archive" } - smilFormatName:string { "tar containing a SMIL" } - - fileChooserDialogTitle:string { "Save File" } - - createExportErrorMsg:string { "Could not export the playlist:" } - saveExportErrorMsg:string { "Could not save the exported playlist." } - } - - transportList:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - cancelUploadMenuItem:string { "#Cancel upload#" } - cancelDownloadMenuItem:string { "#Cancel download#" } - - cannotCancelTransportMsg:string { "#Canceling failed: {0}.#" } - duplicateFileMsg:string { "#the file is in the network " - "hub already.#" } - } - - restoreBackupWindow:table - { - windowTitle:string { "Restore Backup" } - errorMessage:string { "Error: {0}" } - pendingMessage:string { "Uploading backup file\n''{0}''.\n" - "Please wait..." } - finishedMessage:string { "Upload finished." } - } - - metadataTypes:table - { - title:string { "Cím" } - creator:string { "Előadó" } - album:string { "Lemez" } - year:string { "Év" } - genre:string { "Műfaj" } - description:string { "Megjegyzés" } - format:string { "Típus" } - length:string { "Hossz" } - bpm:string { "Tempó (BPM)" } - rating:string { "Értékelés" } - encoded_by:string { "Rögzítő neve" } - track_number:string { "Hányadik szám" } - disc_number:string { "Hányadik lemez" } - mood:string { "Hangulat" } - publishing_label:string { "Kiadó" } - composer:string { "Zeneszerző" } - bitrate:string { "Bitek száma mp-ként" } - channels:string { "Csatornák száma" } - sample_rate:string { "Mintavételi gyakoriság" } - encoding_software:string { "Rögzítő szoftver" } - checksum:string { "Ellenőrző összeg" } - lyrics:string { "Dalszöveg" } - orchestra_or_band:string { "Zenekar vagy együttes" } - conductor:string { "Karmester" } - lyricist:string { "Szövegíró" } - original_lyricist:string { "Eredeti szövegíró" } - radio_station_name:string { "Rádióadó" } - audio_file_info_url:string { "Zeneszám honlapja" } - artist_url:string { "Előadó honlapja" } - audio_source_url:string { "Forrás honlapja" } - radio_station_url:string { "Rádióadó honlapja" } - buy_cd_url:string { "CD-bolt honlapja" } - isrc_number:string { "ISRC-szám" } - catalog_number:string { "Katalógusszám" } - original_artist:string { "Eredeti előadó" } - copyright:string { "Szerzői jog tulajdonosa" } - report_date_time:string { "Report date/time" } - report_location:string { "Report location" } - report_organizations:string { "Report organizations" } - subject:string { "Subject" } - } - - keyboardShortcuts:table - { - playAudio:string { "Play" } - pauseAudio:string { "Pause" } - stopAudio:string { "Stop" } - nextTrack:string { "Next track" } - fadeOut:string { "Fade out" } - moveItemUp:string { "Move item up" } - moveItemDown:string { "Move item down" } - removeItem:string { "Remove item" } - } -} - diff --git a/src/products/gLiveSupport/var/icon16.png b/src/products/gLiveSupport/var/icon16.png deleted file mode 100644 index 3738d50a6..000000000 Binary files a/src/products/gLiveSupport/var/icon16.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/icon22.png b/src/products/gLiveSupport/var/icon22.png deleted file mode 100644 index e547be12f..000000000 Binary files a/src/products/gLiveSupport/var/icon22.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/icon32.png b/src/products/gLiveSupport/var/icon32.png deleted file mode 100644 index caaf9bd16..000000000 Binary files a/src/products/gLiveSupport/var/icon32.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/icon48.png b/src/products/gLiveSupport/var/icon48.png deleted file mode 100644 index 9b2bc0be1..000000000 Binary files a/src/products/gLiveSupport/var/icon48.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/nl.txt b/src/products/gLiveSupport/var/nl.txt deleted file mode 100644 index 0ce8ca88d..000000000 --- a/src/products/gLiveSupport/var/nl.txt +++ /dev/null @@ -1,466 +0,0 @@ -nl:table -{ - cancelButtonLabel:string { "Cancel" } - noButtonLabel:string { "No" } - yesButtonLabel:string { "Yes" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Locale {0} niet beschikbaar" } - schedulerNotReachableMsg:string { "Scheduler server niet beschikbaar" } - storageNotReachableMsg:string { "Storage server niet beschikbaar" } - authenticationNotReachableMsg:string - { "Authentication server niet " - "beschikbaar.\n" - "Would you like to edit the server " - "settings?" } - audioErrorMsg { "Audio player fout: " } - - masterPanelWindow:table - { - windowTitle:string { "Master Panel" } - - notLoggedInMsg:string { "Niet aangemeld" } - loggedInMsg:string { "Aangemeld: {0}" } - loginButtonLabel:string { "Aanmelden" } - logoutButtonLabel:string { "Afmelden" } - liveModeButtonLabel:string { "Live mode" } - uploadFileButtonLabel:string { "Bestand toevoegen" } - scratchpadButtonLabel:string { "Scratchpad" } - playlistButtonLabel:string { "Playlist" } - schedulerButtonLabel:string { "Scheduler" } - searchButtonLabel:string { "Zoeken" } - optionsButtonLabel:string { "Options" } - - elapsedTimeLabel:string { "elapsed" } - remainingTimeLabel:string { "remaining" } - - sureToExitMsg:string { "Are you sure you want to exit?" } - } - - loginWindow:table - { - windowTitle:string { "AANMELDEN" } - - userNameLabel:string { "Gebruikersnaam" } - passwordLabel:string { "Wachtwoord" } - languageLabel:string { "#Language#" } - - pleaseWaitMsg:string { "Logging in, please wait." } - } - - audioClipListWindow:table - { - windowTitle:string { "Audio Clip" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "lengte" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "sluiten" } - } - - scratchpadWindow:table - { - windowTitle:string { "Scratchpad" } - - creatorColumnLabel:string { "Maker" } - titleColumnLabel:string { "Titel" } - addToPlaylistButtonLabel:string { "Toevoegen aan Playlist" } - clearListButtonLabel:string { "Lijst leeg maken" } - removeButtonLabel:string { "Verwijder item" } - - cueMenuItem:string { "_Cue" } - addToLiveModeMenuItem:string { "Toevoegen aan _Live Mode" } - addToPlaylistMenuItem:string { "Toevoegen aan _Playlist" } - removeMenuItem:string { "_Verwijderen" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - playlistListWindow:table - { - windowTitle:string { "Playlist" } - - listBoxLabel { "Playlists" } - detailBoxLabel { "Playlist details" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "lengte" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "sluiten" } - } - - uploadFileWindow:table - { - windowTitle:string { "Bestand toevoegen" } - - chooseFileLabel:string { "Bestandsnaam" } - chooseFileButtonLabel:string { "Bladeren" } - - mainSectionLabel:string { "Algemeen" } - musicSectionLabel:string { "Music" } - voiceSectionLabel:string { "Voice" } - - lengthLabel:string { "Duur" } - - uploadButtonLabel:string { "Verzenden" } - closeButtonLabel:string { "Annuleer" } - - fileChooserDialogTitle:string { "Kies een bestand" } - fileUploadedMsg:string { "Bestand ''{0}'' verzonden." } - couldNotOpenFileMsg:string { "Bestand kan niet geopend worden" } - couldNotReadLengthMsg:string { "#Could not determine audio clip " - "length.#" } - unsupportedFileTypeMsg:string { "#Unsupported file type.#" } - missingTitleMsg:string { "Voeg de titel omschrijving in" } - badMetadataMsg:string { "#Invalid data for {0}.#" } - duplicateFileMsg:string { "#Error: the file is in the storage " - "already.#" } - } - - playlistWindow:table - { - windowTitle:string { "Playlist beheer" } - - startColumnLabel:string { "start" } - titleColumnLabel:string { "titel" } - lengthColumnLabel:string { "lengte" } - fadeInColumnLabel:string { "Fade in" } - fadeOutColumnLabel:string { "Fade out" } - - nameLabel:string { "naam" } - saveButtonLabel:string { "opslaan" } - closeButtonLabel:string { "sluiten" } - lockFadesCheckButtonLabel:string - { "Lock fade-out to following fade-in" } - - upMenuItem:string { "Move _Up" } - downMenuItem:string { "Move D_own" } - removeMenuItem:string { "_Remove" } - - playlistSavedMsg:string { "playlist {0} opgeslagen" } - savePlaylistDialogMsg:string { "Do you want to save the playlist?" } - closeWithoutSavingButtonLabel:string - { "#Close without Saving#" } - emptyTitleErrorMsg:string { "Please enter a title." } - } - - schedulerWindow:table - { - windowTitle:string { "Scheduler" } - - scheduleTab:string { "Schedule" } - statusTab:string { "Status" } - - startColumnLabel:string { "start" } - titleColumnLabel:string { "titel" } - endColumnLabel:string { "einde" } - deleteMenuItem:string { "_Verwijder" } - - stopCurrentlyPlayingButtonLabel:string { "Stop" } - stopCurrentlyPlayingText:string { "what is currently playing " - "in the scheduler." } - stopCurrentlyPlayingDialogMsg:string { "Are you sure?" } - - closeButtonLabel:string { "sluiten" } - - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Schedule Playlist" } - - hourLabel:string { "uur: " } - minuteLabel:string { "minuten: " } - secondLabel:string { "seconds: " } - scheduleButtonLabel:string { "schedule" } - closeButtonLabel:string { "sluiten" } - } - - searchWindow:table - { - windowTitle:string { "Zoeken/Bladeren" } - - searchWhereLabel:string { "Search or browse on: " } - searchWhereLocal:string { "local storage" } - searchWhereRemote:string { "network hub" } - - simpleSearchTab:string { "Zoeken" } - advancedSearchTab:string { "Geadvanceerd" } - browseTab:string { "Bladeren" } - transportsTab:string { "Transfers" } - - searchButtonLabel:string { "Zoeken" } - backwardButtonLabel:string { "⇦ Previous" } - forwardButtonLabel:string { "Next ⇨" } - searchResultsCountLabel:string { "{0}-{1} of {2} results" } - - typeColumnLabel:string { "Type" } - titleColumnLabel:string { "Titel" } - creatorColumnLabel:string { "Maker" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Lengte" } - - allStringForBrowse { "--- alle ---" } - - addToScratchpadMenuItem:string { "Toevoegen aan _Scratchpad" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - addToLiveModeMenuItem:string { "Toevoegen aan _Live Mode" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to the network hub" } - downloadFromHubMenuItem:string { "Download from the network hub" } - - pleaseWaitMsg:string { "Please wait..." } - shortErrorMsg:string { "Search failed." } - longErrorMsg:string { "Search failed: {0}." } - uploadToHubErrorMsg:string { "Uploading to hub failed: {0}." } - downloadFromHubErrorMsg:string { "Downloading from hub failed: {0}." } - nothingFoundMsg:string { "No files found." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "File types" } - allFileType:string { "all" } - audioClipFileType:string { "audio clips" } - playlistFileType:string { "playlists" } - - searchByTextLabel:string { "Zoeken met" } - - partialOperatorDisplay:string { "contains" } - prefixOperatorDisplay:string { "start met" } - =OperatorDisplay:string { "gelijk aan" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Live Mode" } - - playMenuItem:string { "_Play" } - cueMenuItem:string { "_Cue" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - removeMenuItem:string { "_Verwijderen" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cuePlayerLabel:string { "Cue" } - autoPlayNextLabel:string { "#Play the next item automatically#" } - - clearListButtonLabel:string { "Clear list" } - removeButtonLabel:string { "Remove item(s)" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - optionsWindow:table - { - windowTitle:string { "Options" } - - needToRestartMsg:string { "You will need to restart the " - "application\nfor the new settings " - "to take effect." } - errorMsg:string { "Could not save the options: " } - - soundSectionLabel:string { "Sound" } - keyBindingsSectionLabel:string { "Keyboard Shortcuts" } - serversSectionLabel:string { "Servers" } - schedulerSectionLabel:string { "Scheduler" } - backupSectionLabel:string { "Backup" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "About" } - - cancelButtonLabel:string { "Cancel" } - applyButtonLabel:string { "Apply" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Cue audio device:" } - outputDeviceLabel:string { "Live Mode audio device:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Press a key..." } - keyBindingsInstructionsText:string - { "Double-click on the shortcut you want " - "to change, \n" - "then press the key for the new " - "shortcut\n" - "(or press the Escape key to cancel " - "the operation)." } - - authenticationLabel:string { "Authentication server" } - storageLabel:string { "Storage server" } - schedulerLabel:string { "Scheduler server" } - serverLabel:string { "address:" } - portLabel:string { "port:" } - pathLabel:string { "path:" } - - schedulerStatusText:string { "The scheduler is" } - schedulerRunningStatus:string { "running." } - schedulerStoppedStatus:string { "stopped." } - schedulerStartButtonLabel:string { "Start" } - schedulerStopButtonLabel:string { "Stop" } - - reportBugsToText:string { "Report bugs to: {0}" } - } - - backupView:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - mtimeTextLabel:string { "#Modified since:#" } - chooseTimeButtonLabel:string { "#Choose time#" } - resetTimeButtonLabel:string { "#Reset#" } - - backupButtonLabel:string { "#Backup#" } - deleteButtonLabel:string { "#Delete#" } - saveButtonLabel:string { "#Save#" } - - backupTitleLabel:string { "#Title:#" } - defaultBackupTitle:string { "#new backup#" } - - fileChooserDialogTitle:string { "#Save File#" } - backupErrorMsg:string { "#Backup error: #" } - } - - rdsView:table - { - deviceLabel:string { "#Serial port:#" } - PSrdsLabel:string { "#Station name:#" } - PIrdsLabel:string { "#Station code:#" } - RTrdsLabel:string { "#Clip info:#" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Select the date and time" } - - cancelButtonLabel:string { "Cancel" } - okButtonLabel:string { "OK" } - - hourLabel:string { "hour:" } - minuteLabel:string { "minute:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Export Playlist" } - - playlistTitleLabel:string { "Title:" } - formatLabel:string { "Export as:" } - - cancelButtonLabel:string { "Cancel" } - saveButtonLabel:string { "Save" } - - internalFormatName:string { "Campcaster archive" } - smilFormatName:string { "tar containing a SMIL" } - - fileChooserDialogTitle:string { "Save File" } - - createExportErrorMsg:string { "Could not export the playlist:" } - saveExportErrorMsg:string { "Could not save the exported playlist." } - } - - transportList:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - cancelUploadMenuItem:string { "#Cancel upload#" } - cancelDownloadMenuItem:string { "#Cancel download#" } - - cannotCancelTransportMsg:string { "#Canceling failed: {0}.#" } - duplicateFileMsg:string { "#the file is in the network " - "hub already.#" } - } - - restoreBackupWindow:table - { - windowTitle:string { "Restore Backup" } - errorMessage:string { "Error: {0}" } - pendingMessage:string { "Uploading backup file\n''{0}''.\n" - "Please wait..." } - finishedMessage:string { "Upload finished." } - } - - metadataTypes:table - { - title:string { "Titel" } - creator:string { "Maker" } - album:string { "Album" } - year:string { "Jaar" } - genre:string { "Genre" } - description:string { "Omschrijving" } - format:string { "Format" } - length:string { "Lengte" } - bpm:string { "BPM" } - rating:string { "Waardering" } - encoded_by:string { "Geencodeerd door" } - track_number:string { "Track nummer" } - disc_number:string { "Disk nummer" } - mood:string { "Stemming" } - publishing_label:string { "Platen label" } - composer:string { "Componist" } - bitrate:string { "Bitrate" } - channels:string { "Kanalen" } - sample_rate:string { "Sample rate" } - encoding_software:string { "Encoder software" } - checksum:string { "Controlegetal" } - lyrics:string { "Tekst schrijver" } - orchestra_or_band:string { "Orkest of band" } - conductor:string { "Dirigent" } - lyricist:string { "Schrijver" } - original_lyricist:string { "Originele schrijver" } - radio_station_name:string { "Naam van het station" } - audio_file_info_url:string { "Web pagina met audio informatie" } - artist_url:string { "Web pagina van artiest" } - audio_source_url:string { "Web pagina van de audio bron" } - radio_station_url:string { "Website van het station" } - buy_cd_url:string { "Online CD bestellen" } - isrc_number:string { "ISRC nummer" } - catalog_number:string { "Catalogus nummer" } - original_artist:string { "Originele artiest" } - copyright:string { "Copyright" } - report_date_time:string { "Report date/time" } - report_location:string { "Report location" } - report_organizations:string { "Report organizations" } - subject:string { "Subject" } - } - - keyboardShortcuts:table - { - playAudio:string { "Play" } - pauseAudio:string { "Pause" } - stopAudio:string { "Stop" } - nextTrack:string { "Next track" } - fadeOut:string { "Fade out" } - moveItemUp:string { "Move item up" } - moveItemDown:string { "Move item down" } - removeItem:string { "Remove item" } - } -} - diff --git a/src/products/gLiveSupport/var/pl.txt b/src/products/gLiveSupport/var/pl.txt deleted file mode 100644 index 35f10c067..000000000 --- a/src/products/gLiveSupport/var/pl.txt +++ /dev/null @@ -1,465 +0,0 @@ -pl:table -{ - cancelButtonLabel:string { "Anuluj" } - noButtonLabel:string { "Nie" } - yesButtonLabel:string { "Tak" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Język {0} nie jest dostępny" } - schedulerNotReachableMsg:string { "Serwer programacji nie jest dostępny" } - storageNotReachableMsg:string { "Serwer plików nie jest dostępny" } - authenticationNotReachableMsg:string - { "Serwer logowania nie jest dostępny.\n" - "Would you like to edit the server " - "settings?" } - audioErrorMsg { "Błąd odtwarzacz: " } - - masterPanelWindow:table - { - windowTitle:string { "Okno główne" } - - notLoggedInMsg:string { "Nie zalogowany" } - loggedInMsg:string { "Zalogowany: {0}" } - loginButtonLabel:string { "Zaloguj" } - logoutButtonLabel:string { "Wyloguj" } - liveModeButtonLabel:string { "Na żywo" } - uploadFileButtonLabel:string { "Załaduj plik" } - scratchpadButtonLabel:string { "Przybornik" } - playlistButtonLabel:string { "Listę utworów" } - schedulerButtonLabel:string { "Programacja" } - searchButtonLabel:string { "Szukaj" } - optionsButtonLabel:string { "Options" } - - elapsedTimeLabel:string { "minęło" } - remainingTimeLabel:string { "zostało" } - - sureToExitMsg:string { "Czy na pewno opuścić program ?" } - } - - loginWindow:table - { - windowTitle:string { "LOGOWANIE" } - - userNameLabel:string { "Login" } - passwordLabel:string { "Hasło" } - languageLabel:string { "#Language#" } - - pleaseWaitMsg:string { "Logging in, please wait." } - } - - audioClipListWindow:table - { - windowTitle:string { "Okno utworu" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "długość" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "zamknij" } - } - - scratchpadWindow:table - { - windowTitle:string { "Przybornik" } - - creatorColumnLabel:string { "Autor" } - titleColumnLabel:string { "Tytuł" } - addToPlaylistButtonLabel:string { "Dodaj do listy utworów" } - clearListButtonLabel:string { "Wyczyść listę" } - removeButtonLabel:string { "Usuń element(y)" } - - cueMenuItem:string { "Po_słuchaj" } - addToLiveModeMenuItem:string { "Dodaj do _Na żywo" } - addToPlaylistMenuItem:string { "_Dodaj do listy utworów" } - removeMenuItem:string { "_Usuń" } - editPlaylistMenuItem:string { "_Edytuj" } - schedulePlaylistMenuItem:string { "_Programacja" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cannotEditPlaylistMsg:string - { "Nie udało się otworzyć listę do edycji." } - } - - playlistListWindow:table - { - windowTitle:string { "Okno listy utworów" } - - listBoxLabel { "Listy utworów" } - detailBoxLabel { "Szczegóły" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "długość" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "zamknij" } - } - - uploadFileWindow:table - { - windowTitle:string { "Załaduj plik" } - - chooseFileLabel:string { "Nazwa pliku" } - chooseFileButtonLabel:string { "Przeglądaj" } - - mainSectionLabel:string { "Start" } - musicSectionLabel:string { "Muzyka" } - voiceSectionLabel:string { "Audycja" } - - lengthLabel:string { "Długość" } - - uploadButtonLabel:string { "Załaduj" } - closeButtonLabel:string { "Anuluj" } - - fileChooserDialogTitle:string { "Wybierz plik" } - fileUploadedMsg:string { "Plik ''{0}'' został załadowany." } - couldNotOpenFileMsg:string { "Nie udało się otworzyć pliku." } - couldNotReadLengthMsg:string { "Nie udało się ustalić długość " - "pliku." } - unsupportedFileTypeMsg:string { "To rozszerzenie nie jest obsługiwane." } - missingTitleMsg:string { "Proszę wprowadzić tytuł." } - badMetadataMsg:string { "#Invalid data for {0}.#" } - duplicateFileMsg:string { "#Error: the file is in the storage " - "already.#" } - } - - playlistWindow:table - { - windowTitle:string { "Zarządzanie listą utworów" } - - startColumnLabel:string { "Początek" } - titleColumnLabel:string { "Tytuł" } - lengthColumnLabel:string { "Długość" } - fadeInColumnLabel:string { "Wprowadzenie" } - fadeOutColumnLabel:string { "Zakończenie" } - - nameLabel:string { "Nazwa" } - saveButtonLabel:string { "Zapisz" } - closeButtonLabel:string { "Zamknij" } - lockFadesCheckButtonLabel:string - { "Zablokuj zakończenie do następnego " - "wprowadzenia" } - - upMenuItem:string { "Do _Góry" } - downMenuItem:string { "Do D_ołu" } - removeMenuItem:string { "_Usuń" } - - playlistSavedMsg:string { "Zapisano listę utworów ''{0}''." } - savePlaylistDialogMsg:string { "Czy chcesz zapisać listę utworów?" } - closeWithoutSavingButtonLabel:string - { "#Close without Saving#" } - emptyTitleErrorMsg:string { "Proszę wprowadzić tytuł." } - } - - schedulerWindow:table - { - windowTitle:string { "Okno programacji" } - - scheduleTab:string { "Schedule" } - statusTab:string { "Status" } - - startColumnLabel:string { "Początek" } - titleColumnLabel:string { "tytuł" } - endColumnLabel:string { "koniec" } - deleteMenuItem:string { "_Usuń" } - - stopCurrentlyPlayingButtonLabel:string { "Stop" } - stopCurrentlyPlayingText:string { "what is currently playing " - "in the scheduler." } - stopCurrentlyPlayingDialogMsg:string { "Are you sure?" } - - closeButtonLabel:string { "zamknij" } - - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Programacja listy utworów" } - - hourLabel:string { "godzina: " } - minuteLabel:string { "minuta: " } - secondLabel:string { "seconds: " } - scheduleButtonLabel:string { "zaprogramuj" } - closeButtonLabel:string { "zamknij" } - } - - searchWindow:table - { - windowTitle:string { "Szukaj/Przeglądaj" } - - searchWhereLabel:string { "Search or browse on: " } - searchWhereLocal:string { "local storage" } - searchWhereRemote:string { "network hub" } - - simpleSearchTab:string { "Szukaj" } - advancedSearchTab:string { "Szukanie zaawansowane" } - browseTab:string { "Przeglądaj" } - transportsTab:string { "Transfers" } - - searchButtonLabel:string { "Szukaj" } - backwardButtonLabel:string { "⇦ Previous" } - forwardButtonLabel:string { "Next ⇨" } - searchResultsCountLabel:string { "{0}-{1} of {2} results" } - - typeColumnLabel:string { "Rodzaj" } - titleColumnLabel:string { "Tytuł" } - creatorColumnLabel:string { "Autor" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Długość" } - - allStringForBrowse { "--- wszystko ---" } - - addToScratchpadMenuItem:string { "_Dodaj do przybornika" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - addToLiveModeMenuItem:string { "Dodaj do _Na żywo" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to the network hub" } - downloadFromHubMenuItem:string { "Download from the network hub" } - - pleaseWaitMsg:string { "Please wait..." } - shortErrorMsg:string { "Search failed." } - longErrorMsg:string { "Search failed: {0}." } - uploadToHubErrorMsg:string { "Uploading to hub failed: {0}." } - downloadFromHubErrorMsg:string { "Downloading from hub failed: {0}." } - nothingFoundMsg:string { "No files found." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "File types" } - allFileType:string { "all" } - audioClipFileType:string { "audio clips" } - playlistFileType:string { "playlists" } - - searchByTextLabel:string { "Szukaj po" } - - partialOperatorDisplay:string { "zawiera" } - prefixOperatorDisplay:string { "zaczyna się od" } - =OperatorDisplay:string { "równa się" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Na żywo" } - - playMenuItem:string { "_Zagraj" } - cueMenuItem:string { "Po_słuchaj" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - removeMenuItem:string { "_Usuń" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cuePlayerLabel:string { "Podgląd" } - - clearListButtonLabel:string { "Clear list" } - removeButtonLabel:string { "Remove item(s)" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - optionsWindow:table - { - windowTitle:string { "Options" } - - needToRestartMsg:string { "You will need to restart the " - "application\nfor the new settings " - "to take effect." } - errorMsg:string { "Could not save the options: " } - - soundSectionLabel:string { "Sound" } - keyBindingsSectionLabel:string { "Keyboard Shortcuts" } - serversSectionLabel:string { "Servers" } - schedulerSectionLabel:string { "Scheduler" } - backupSectionLabel:string { "Backup" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "About" } - - cancelButtonLabel:string { "Cancel" } - applyButtonLabel:string { "Apply" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Cue audio device:" } - outputDeviceLabel:string { "Live Mode audio device:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Press a key..." } - keyBindingsInstructionsText:string - { "Double-click on the shortcut you want " - "to change, \n" - "then press the key for the new " - "shortcut\n" - "(or press the Escape key to cancel " - "the operation)." } - - authenticationLabel:string { "Authentication server" } - storageLabel:string { "Storage server" } - schedulerLabel:string { "Scheduler server" } - serverLabel:string { "address:" } - portLabel:string { "port:" } - pathLabel:string { "path:" } - - schedulerStatusText:string { "The scheduler is" } - schedulerRunningStatus:string { "running." } - schedulerStoppedStatus:string { "stopped." } - schedulerStartButtonLabel:string { "Start" } - schedulerStopButtonLabel:string { "Stop" } - - reportBugsToText:string { "Report bugs to: {0}" } - } - - backupView:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - mtimeTextLabel:string { "#Modified since:#" } - chooseTimeButtonLabel:string { "#Choose time#" } - resetTimeButtonLabel:string { "#Reset#" } - - backupButtonLabel:string { "#Backup#" } - deleteButtonLabel:string { "#Delete#" } - saveButtonLabel:string { "#Save#" } - - backupTitleLabel:string { "#Title:#" } - defaultBackupTitle:string { "#new backup#" } - - fileChooserDialogTitle:string { "#Save File#" } - backupErrorMsg:string { "#Backup error: #" } - } - - rdsView:table - { - deviceLabel:string { "#Serial port:#" } - PSrdsLabel:string { "#Station name:#" } - PIrdsLabel:string { "#Station code:#" } - RTrdsLabel:string { "#Clip info:#" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Select the date and time" } - - cancelButtonLabel:string { "Cancel" } - okButtonLabel:string { "OK" } - - hourLabel:string { "hour:" } - minuteLabel:string { "minute:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Export Playlist" } - - playlistTitleLabel:string { "Title:" } - formatLabel:string { "Export as:" } - - cancelButtonLabel:string { "Cancel" } - saveButtonLabel:string { "Save" } - - internalFormatName:string { "Campcaster archive" } - smilFormatName:string { "tar containing a SMIL" } - - fileChooserDialogTitle:string { "Save File" } - - createExportErrorMsg:string { "Could not export the playlist:" } - saveExportErrorMsg:string { "Could not save the exported playlist." } - } - - transportList:table - { - workingStatus:string { "#In progress...#" } - successStatus:string { "#Ready#" } - faultStatus:string { "#Error: {0}#" } - - titleColumnLabel:string { "#Title#" } - dateColumnLabel:string { "#Date#" } - statusColumnLabel:string { "#Status#" } - - cancelUploadMenuItem:string { "#Cancel upload#" } - cancelDownloadMenuItem:string { "#Cancel download#" } - - cannotCancelTransportMsg:string { "#Canceling failed: {0}.#" } - duplicateFileMsg:string { "#the file is in the network " - "hub already.#" } - } - - restoreBackupWindow:table - { - windowTitle:string { "Restore Backup" } - errorMessage:string { "Error: {0}" } - pendingMessage:string { "Uploading backup file\n''{0}''.\n" - "Please wait..." } - finishedMessage:string { "Upload finished." } - } - - metadataTypes:table - { - title:string { "Tytuł" } - creator:string { "Autor" } - album:string { "Płyta" } - year:string { "Rok" } - genre:string { "Rodzaj" } - description:string { "Opis" } - format:string { "Format" } - length:string { "Długość" } - bpm:string { "BPM" } - rating:string { "Rating" } - encoded_by:string { "Skompresowany przez" } - track_number:string { "Numer utworu" } - disc_number:string { "Numer płyty" } - mood:string { "Mood" } - publishing_label:string { "Znacznik publikacji" } - composer:string { "Composer" } - bitrate:string { "Bitrate" } - channels:string { "Kanały" } - sample_rate:string { "Sample rate" } - encoding_software:string { "Encoding software" } - checksum:string { "Checksum" } - lyrics:string { "Lyrics" } - orchestra_or_band:string { "Orchiestra lub grupa" } - conductor:string { "Conductor" } - lyricist:string { "Lyricist" } - original_lyricist:string { "Original lyricist" } - radio_station_name:string { "Nazwa statcji radiowej" } - audio_file_info_url:string { "Strona o pliku" } - artist_url:string { "Strona o autorze" } - audio_source_url:string { "Strona pochodzenia pliku" } - radio_station_url:string { "Strona stacji radiowej" } - buy_cd_url:string { "Strona zakupu CD" } - isrc_number:string { "ISRC number" } - catalog_number:string { "Catalog number" } - original_artist:string { "Original artist" } - copyright:string { "Copyright" } - report_date_time:string { "Report date/time" } - report_location:string { "Report location" } - report_organizations:string { "Report organizations" } - subject:string { "Subject" } - } - - keyboardShortcuts:table - { - playAudio:string { "Play" } - pauseAudio:string { "Pause" } - stopAudio:string { "Stop" } - nextTrack:string { "Next track" } - fadeOut:string { "Fade out" } - moveItemUp:string { "Move item up" } - moveItemDown:string { "Move item down" } - removeItem:string { "Remove item" } - } -} - diff --git a/src/products/gLiveSupport/var/root.txt b/src/products/gLiveSupport/var/root.txt deleted file mode 100644 index 8d5f64002..000000000 --- a/src/products/gLiveSupport/var/root.txt +++ /dev/null @@ -1,467 +0,0 @@ -root:table -{ - cancelButtonLabel:string { "Cancel" } - noButtonLabel:string { "No" } - yesButtonLabel:string { "Yes" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Locale {0} is not available." } - schedulerNotReachableMsg:string { "The scheduler server is not available." } - storageNotReachableMsg:string { "The storage server is not available." } - authenticationNotReachableMsg:string - { "The authentication server is not " - "available.\n" - "Would you like to edit the server " - "settings?" } - audioErrorMsg { "Audio player error: " } - - masterPanelWindow:table - { - windowTitle:string { "Master Panel" } - - notLoggedInMsg:string { "Not logged in" } - loggedInMsg:string { "User: {0}" } - loginButtonLabel:string { "Log in" } - logoutButtonLabel:string { "Log out" } - liveModeButtonLabel:string { "Live Mode" } - uploadFileButtonLabel:string { "Upload File" } - scratchpadButtonLabel:string { "Scratchpad" } - playlistButtonLabel:string { "Playlist" } - schedulerButtonLabel:string { "Scheduler" } - searchButtonLabel:string { "Search" } - optionsButtonLabel:string { "Options" } - - elapsedTimeLabel:string { "elapsed" } - remainingTimeLabel:string { "remaining" } - - sureToExitMsg:string { "Are you sure you want to exit?" } - } - - loginWindow:table - { - windowTitle:string { "Login" } - - userNameLabel:string { "User name" } - passwordLabel:string { "Password" } - languageLabel:string { "Language" } - - pleaseWaitMsg:string { "Logging in, please wait." } - } - - audioClipListWindow:table - { - windowTitle:string { "Audio Clip List" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "length" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "close" } - } - - scratchpadWindow:table - { - windowTitle:string { "Scratchpad" } - - creatorColumnLabel:string { "Creator" } - titleColumnLabel:string { "Title" } - addToPlaylistButtonLabel:string { "Add to playlist" } - clearListButtonLabel:string { "Clear list" } - removeButtonLabel:string { "Remove item(s)" } - - cueMenuItem:string { "Pre_view" } - addToLiveModeMenuItem:string { "Add to _Live Mode" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - removeMenuItem:string { "_Remove" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - playlistListWindow:table - { - windowTitle:string { "Playlist" } - - listBoxLabel { "Playlists" } - detailBoxLabel { "Playlist details" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "length" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "token" } - - closeButtonLabel:string { "close" } - } - - uploadFileWindow:table - { - windowTitle:string { "Upload File" } - - chooseFileLabel:string { "Filename" } - chooseFileButtonLabel:string { "Browse" } - - mainSectionLabel:string { "Main" } - musicSectionLabel:string { "Music" } - voiceSectionLabel:string { "Voice" } - - lengthLabel:string { "Duration" } - - uploadButtonLabel:string { "Upload" } - closeButtonLabel:string { "Cancel" } - - fileChooserDialogTitle:string { "Open File" } - fileUploadedMsg:string { "Uploaded ''{0}''." } - couldNotOpenFileMsg:string { "The file could not be opened." } - couldNotReadLengthMsg:string { "Could not determine audio clip " - "length." } - unsupportedFileTypeMsg:string { "Unsupported file type." } - missingTitleMsg:string { "Please enter a title." } - badMetadataMsg:string { "Invalid data for {0}." } - duplicateFileMsg:string { "Error: the file is in the storage " - "already." } - } - - playlistWindow:table - { - windowTitle:string { "Edit Playlist" } - - startColumnLabel:string { "Start" } - titleColumnLabel:string { "Title" } - lengthColumnLabel:string { "Length" } - fadeInColumnLabel:string { "Fade in" } - fadeOutColumnLabel:string { "Fade out" } - - nameLabel:string { "Name" } - lengthLabel:string { "Duration:" } - saveButtonLabel:string { "Save" } - closeButtonLabel:string { "Close" } - lockFadesCheckButtonLabel:string - { "Lock fade-out to following fade-in" } - - upMenuItem:string { "Move _Up" } - downMenuItem:string { "Move D_own" } - removeMenuItem:string { "_Remove" } - - playlistSavedMsg:string { "Saved playlist ''{0}''." } - savePlaylistDialogMsg:string { "Do you want to save the playlist?" } - closeWithoutSavingButtonLabel:string - { "Close without Saving" } - emptyTitleErrorMsg:string { "Please enter a title." } - } - - schedulerWindow:table - { - windowTitle:string { "Scheduler" } - - scheduleTab:string { "Schedule" } - statusTab:string { "Status" } - - startColumnLabel:string { "start" } - titleColumnLabel:string { "title" } - endColumnLabel:string { "end" } - deleteMenuItem:string { "_Delete" } - - stopCurrentlyPlayingButtonLabel:string { "Stop" } - stopCurrentlyPlayingText:string { "what is currently playing " - "in the scheduler." } - stopCurrentlyPlayingDialogMsg:string { "Are you sure?" } - - closeButtonLabel:string { "Close" } - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Schedule Playlist" } - - hourLabel:string { "hour: " } - minuteLabel:string { "minute: " } - secondLabel:string { "seconds: " } - scheduleButtonLabel:string { "schedule" } - closeButtonLabel:string { "close" } - } - - searchWindow:table - { - windowTitle:string { "Search/Browse" } - - searchWhereLabel:string { "Search or browse on: " } - searchWhereLocal:string { "local storage" } - searchWhereRemote:string { "network hub" } - - simpleSearchTab:string { "Search" } - advancedSearchTab:string { "Advanced Search" } - browseTab:string { "Browse" } - transportsTab:string { "Transfers" } - - searchButtonLabel:string { "Search" } - backwardButtonLabel:string { "⇦ Previous" } - forwardButtonLabel:string { "Next ⇨" } - searchResultsCountLabel:string { "{0}-{1} of {2} results" } - - typeColumnLabel:string { "Type" } - titleColumnLabel:string { "Title" } - creatorColumnLabel:string { "Creator" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Length" } - - allStringForBrowse { "--- all ---" } - - addToScratchpadMenuItem:string { "Add To S_cratchpad" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - addToLiveModeMenuItem:string { "Add To _Live Mode" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to the network hub" } - downloadFromHubMenuItem:string { "Download from the network hub" } - - pleaseWaitMsg:string { "Please wait..." } - shortErrorMsg:string { "Search failed." } - longErrorMsg:string { "Search failed: {0}." } - uploadToHubErrorMsg:string { "Uploading to hub failed: {0}." } - downloadFromHubErrorMsg:string { "Downloading from hub failed: {0}." } - nothingFoundMsg:string { "No files found." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "File types" } - allFileType:string { "all" } - audioClipFileType:string { "audio clips" } - playlistFileType:string { "playlists" } - - searchByTextLabel:string { "Search by" } - - partialOperatorDisplay:string { "contains" } - prefixOperatorDisplay:string { "starts with" } - =OperatorDisplay:string { "equals" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Live Mode" } - - playMenuItem:string { "_Play" } - cueMenuItem:string { "Pre_view" } - addToPlaylistMenuItem:string { "_Add to Playlist" } - removeMenuItem:string { "_Remove" } - editPlaylistMenuItem:string { "_Edit Playlist" } - schedulePlaylistMenuItem:string { "_Schedule Playlist" } - exportPlaylistMenuItem:string { "E_xport Playlist" } - uploadToHubMenuItem:string { "Upload to Network Hub" } - - cuePlayerLabel:string { "Preview" } - autoPlayNextLabel:string { "Play the next item automatically" } - - clearListButtonLabel:string { "Clear list" } - removeButtonLabel:string { "Remove item(s)" } - - cannotEditPlaylistMsg:string - { "Could not open playlist for editing." } - } - - optionsWindow:table - { - windowTitle:string { "Options" } - - needToRestartMsg:string { "You will need to restart the " - "application\nfor the new settings " - "to take effect." } - errorMsg:string { "Could not save the options: " } - - soundSectionLabel:string { "Sound" } - keyBindingsSectionLabel:string { "Keyboard Shortcuts" } - serversSectionLabel:string { "Servers" } - schedulerSectionLabel:string { "Scheduler" } - backupSectionLabel:string { "Backup" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "About" } - - cancelButtonLabel:string { "Cancel" } - applyButtonLabel:string { "Apply" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Cue audio device:" } - outputDeviceLabel:string { "Live Mode audio device:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Press a key..." } - keyBindingsInstructionsText:string - { "Double-click on the shortcut you want " - "to change, \n" - "then press the key for the new " - "shortcut\n" - "(or press the Escape key to cancel " - "the operation)." } - - authenticationLabel:string { "Authentication server" } - storageLabel:string { "Storage server" } - schedulerLabel:string { "Scheduler server" } - serverLabel:string { "address:" } - portLabel:string { "port:" } - pathLabel:string { "path:" } - - schedulerStatusText:string { "The scheduler is" } - schedulerRunningStatus:string { "running." } - schedulerStoppedStatus:string { "stopped." } - schedulerStartButtonLabel:string { "Start" } - schedulerStopButtonLabel:string { "Stop" } - - reportBugsToText:string { "Report bugs to: {0}" } - creditsText:import { "../../../../CREDITS" } - } - - backupView:table - { - workingStatus:string { "In progress..." } - successStatus:string { "Ready" } - faultStatus:string { "Error: {0}" } - - titleColumnLabel:string { "Title" } - dateColumnLabel:string { "Date" } - statusColumnLabel:string { "Status" } - - mtimeTextLabel:string { "Modified since:" } - chooseTimeButtonLabel:string { "Choose time" } - resetTimeButtonLabel:string { "Reset" } - - backupButtonLabel:string { "Backup" } - deleteButtonLabel:string { "Delete" } - saveButtonLabel:string { "Save" } - - backupTitleLabel:string { "Title:" } - defaultBackupTitle:string { "new backup" } - - fileChooserDialogTitle:string { "Save File" } - backupErrorMsg:string { "Backup error: " } - } - - rdsView:table - { - deviceLabel:string { "Serial port:" } - PSrdsLabel:string { "Station name:" } - PIrdsLabel:string { "Station code:" } - RTrdsLabel:string { "Clip info:" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Select the date and time" } - - cancelButtonLabel:string { "Cancel" } - okButtonLabel:string { "OK" } - - hourLabel:string { "hour:" } - minuteLabel:string { "minute:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Export Playlist" } - - playlistTitleLabel:string { "Title:" } - formatLabel:string { "Export as:" } - - cancelButtonLabel:string { "Cancel" } - saveButtonLabel:string { "Save" } - - internalFormatName:string { "Campcaster archive" } - smilFormatName:string { "tar containing a SMIL" } - - fileChooserDialogTitle:string { "Save File" } - - createExportErrorMsg:string { "Could not export the playlist:" } - saveExportErrorMsg:string { "Could not save the exported playlist." } - } - - transportList:table - { - workingStatus:string { "In progress..." } - successStatus:string { "Ready" } - faultStatus:string { "Error: {0}" } - - titleColumnLabel:string { "Title" } - dateColumnLabel:string { "Date" } - statusColumnLabel:string { "Status" } - - cancelUploadMenuItem:string { "Cancel upload" } - cancelDownloadMenuItem:string { "Cancel download" } - - cannotCancelTransportMsg:string { "Canceling failed: {0}." } - duplicateFileMsg:string { "the file is in the network " - "hub already." } - } - - restoreBackupWindow:table - { - windowTitle:string { "Restore Backup" } - errorMessage:string { "Error: {0}" } - pendingMessage:string { "Uploading backup file\n''{0}''.\n" - "Please wait..." } - finishedMessage:string { "Upload finished." } - } - - metadataTypes:table - { - title:string { "Title" } - creator:string { "Creator" } - album:string { "Album" } - year:string { "Year" } - genre:string { "Genre" } - description:string { "Description" } - format:string { "Format" } - length:string { "Length" } - bpm:string { "BPM" } - rating:string { "Rating" } - encoded_by:string { "Encoded by" } - track_number:string { "Track number" } - disc_number:string { "Disc number" } - mood:string { "Mood" } - publishing_label:string { "Publishing label" } - composer:string { "Composer" } - bitrate:string { "Bitrate" } - channels:string { "Channels" } - sample_rate:string { "Sample rate" } - encoding_software:string { "Encoding software" } - checksum:string { "Checksum" } - lyrics:string { "Lyrics" } - orchestra_or_band:string { "Orchestra or band" } - conductor:string { "Conductor" } - lyricist:string { "Lyricist" } - original_lyricist:string { "Original lyricist" } - radio_station_name:string { "Radio station name" } - audio_file_info_url:string { "File info web page" } - artist_url:string { "Artist web page" } - audio_source_url:string { "Source web page" } - radio_station_url:string { "Radio station web page" } - buy_cd_url:string { "Buy CD web page" } - isrc_number:string { "ISRC number" } - catalog_number:string { "Catalog number" } - original_artist:string { "Original artist" } - copyright:string { "Copyright" } - report_date_time:string { "Report date/time" } - report_location:string { "Report location" } - report_organizations:string { "Report organizations" } - subject:string { "Subject" } - } - - keyboardShortcuts:table - { - playAudio:string { "Play" } - pauseAudio:string { "Pause" } - stopAudio:string { "Stop" } - nextTrack:string { "Next track" } - fadeOut:string { "Fade out" } - moveItemUp:string { "Move item up" } - moveItemDown:string { "Move item down" } - removeItem:string { "Remove item" } - } -} - diff --git a/src/products/gLiveSupport/var/sr_CS.txt b/src/products/gLiveSupport/var/sr_CS.txt deleted file mode 100644 index 8f7f26ef0..000000000 --- a/src/products/gLiveSupport/var/sr_CS.txt +++ /dev/null @@ -1,460 +0,0 @@ -sr_CS:table -{ - cancelButtonLabel:string { "Otkaži" } - noButtonLabel:string { "Ne" } - yesButtonLabel:string { "Da" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Mesto {0} nije dostupno" } - schedulerNotReachableMsg:string { "Server sa rasporedom nije dostupan" } - storageNotReachableMsg:string { "Server nije dostupan" } - authenticationNotReachableMsg:string - { "Server za autentizaciju nije dostupan.\n" - "Da li biste želeli da promenite serverske postavke?" } - audioErrorMsg { "Greška u audio plejeru: " } - - masterPanelWindow:table - { - windowTitle:string { "Glavni panel" } - - notLoggedInMsg:string { "Niste prijavljeni" } - loggedInMsg:string { "Prijavljeni: {0}" } - loginButtonLabel:string { "Prijava" } - logoutButtonLabel:string { "Odjava" } - liveModeButtonLabel:string { "Uživo" } - uploadFileButtonLabel:string { "Aploud" } - scratchpadButtonLabel:string { "Priprema" } - playlistButtonLabel:string { "Plej lista" } - schedulerButtonLabel:string { "Raspored" } - searchButtonLabel:string { "Pretraga" } - optionsButtonLabel:string { "Opcije" } - - elapsedTimeLabel:string { "pozicija" } - remainingTimeLabel:string { "preostalo" } - - sureToExitMsg:string { "Sigurno želite da izađete?" } - } - - loginWindow:table - { - windowTitle:string { "PRIJAVA" } - - userNameLabel:string { "Prijavi se" } - passwordLabel:string { "Lozinka" } - languageLabel:string { "#Language#" } - - pleaseWaitMsg:string { "Prijava je u toku, sačekajte" } - } - - audioClipListWindow:table - { - windowTitle:string { "Audio Klipovi" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "dužina" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "preuzeto" } - - closeButtonLabel:string { "zatvori" } - } - - scratchpadWindow:table - { - windowTitle:string { "Priprema" } - - creatorColumnLabel:string { "Autor" } - titleColumnLabel:string { "Naslov" } - addToPlaylistButtonLabel:string { "Dodaj u plej listu" } - clearListButtonLabel:string { "Obriši listu" } - removeButtonLabel:string { "Ukloni iz liste" } - - cueMenuItem:string { "Proba" } - addToLiveModeMenuItem:string { "Dodaj u Program Uživo" } - addToPlaylistMenuItem:string { "Dodaj u plej listu" } - removeMenuItem:string { "Ukloni" } - editPlaylistMenuItem:string { "Uredi plej listu" } - schedulePlaylistMenuItem:string { "Programiraj plej listu" } - exportPlaylistMenuItem:string { "Prebaci plejlistu" } - uploadToHubMenuItem:string { "Uputi na centralni server" } - - cannotEditPlaylistMsg:string { "Neuspelo otvaranje plejliste" } - } - - playlistListWindow:table - { - windowTitle:string { "Plej lista" } - - listBoxLabel { "Plej liste" } - detailBoxLabel { "Detalji plej liste" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "dužina" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "preuzeto" } - - closeButtonLabel:string { "zatvori" } - } - - uploadFileWindow:table - { - windowTitle:string { "Aploud fajla" } - - chooseFileLabel:string { "Ime fajla" } - chooseFileButtonLabel:string { "Pretraži" } - - mainSectionLabel:string { "Glavno" } - musicSectionLabel:string { "Muzika" } - voiceSectionLabel:string { "Glas" } - - lengthLabel:string { "Trajanje" } - - uploadButtonLabel:string { "Uputi" } - closeButtonLabel:string { "Otkaži" } - - fileChooserDialogTitle:string { "Izaberi fajl" } - fileUploadedMsg:string { "Upućen fajl ''{0}''." } - couldNotOpenFileMsg:string { "Fajl se ne može otvoriti." } - - couldNotReadLengthMsg:string { "Neuspelo određivanje dužine." } - - unsupportedFileTypeMsg:string { "Nepodržavana ekstenzija." } - missingTitleMsg:string { "Unesite naslov." } - badMetadataMsg:string { "Greška u podacima za {0}." } - duplicateFileMsg:string { "Greška:fajl je već u arhivi." } - } - - playlistWindow:table - { - windowTitle:string { "Plej lista" } - - startColumnLabel:string { "počni" } - titleColumnLabel:string { "naslov" } - lengthColumnLabel:string { "dužina" } - fadeInColumnLabel:string { "Fade in" } - fadeOutColumnLabel:string { "Fade out" } - - nameLabel:string { "Ime" } - lengthLabel:string { "#Duration:#" } - saveButtonLabel:string { "Sačuvaj" } - closeButtonLabel:string { "Zatvori" } - lockFadesCheckButtonLabel:string - { "Podesi fade out tako da prati fade in" } - - playlistSavedMsg:string { "Sačuvana plej lista {0}." } - savePlaylistDialogMsg:string { "Sačuvati plejlistu?" } - closeWithoutSavingButtonLabel:string - { "#Close without Saving#" } - emptyTitleErrorMsg:string { "Unesite naslov." } - } - - schedulerWindow:table - { - windowTitle:string { "Raspored" } - - scheduleTab:string { "Raspored emitovanja" } - statusTab:string { "Status" } - - startColumnLabel:string { "početak" } - titleColumnLabel:string { "naziv" } - endColumnLabel:string { "kraj" } - deleteMenuItem:string { "Obriši" } - - stopCurrentlyPlayingButtonLabel:string { "Stop" } - stopCurrentlyPlayingText:string { "trenutno se nalazi u " - "rasporedu emitovanja." } - stopCurrentlyPlayingDialogMsg:string { "Da li ste sigurni?" } - - closeButtonLabel:string { "Zatvori" } - - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Programiranje Plej Liste" } - - hourLabel:string { "sat: " } - minuteLabel:string { "minut: " } - secondLabel:string { "sekunde: " } - scheduleButtonLabel:string { "programiraj" } - closeButtonLabel:string { "zatvori" } - } - - searchWindow:table - { - windowTitle:string { "Pretraga/Pregled" } - - searchWhereLabel:string { "Traži ili pregledaj na: " } - searchWhereLocal:string { "lokalna arhiva" } - searchWhereRemote:string { "centralni server" } - - simpleSearchTab:string { "Pretraga" } - advancedSearchTab:string { "Napredna pretraga" } - browseTab:string { "Pregled" } - transportsTab:string { "Prenesi" } - - searchButtonLabel:string { "Pretraži" } - backwardButtonLabel:string { "⇦ Prethodno" } - forwardButtonLabel:string { "Sledeće ⇨" } - searchResultsCountLabel:string { "{0}-{1} od {2} rezultata" } - - typeColumnLabel:string { "Tip" } - titleColumnLabel:string { "Naslov" } - creatorColumnLabel:string { "Autor" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Dužina" } - - allStringForBrowse { "--- sve ---" } - - addToScratchpadMenuItem:string { "Dodaj u Pripremu " } - addToPlaylistMenuItem:string { "Dodaj u plejlistu" } - addToLiveModeMenuItem:string { "Dodaj u Program Uživo" } - editPlaylistMenuItem:string { "Uredi plejlistu" } - schedulePlaylistMenuItem:string { "Napravi raspored plejliste" } - exportPlaylistMenuItem:string { "Prebaci plejlistu" } - uploadToHubMenuItem:string { "Uputi na centralni server" } - downloadFromHubMenuItem:string { "Preuzmi sa centralnog servera" } - - pleaseWaitMsg:string { "Sačekajte..." } - shortErrorMsg:string { "Neuspela pretraga." } - longErrorMsg:string { "Neuspela pretraga: {0}." } - uploadToHubErrorMsg:string { "Neuspelo upućivanje na centralni server: {0}." } - downloadFromHubErrorMsg:string { "Neuspelo preuzimanje sa centralnog servera: {0}." } - nothingFoundMsg:string { "Fajlovi nisu nađeni." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "Tip fajla" } - allFileType:string { "Svi" } - audioClipFileType:string { "audio klipovi" } - playlistFileType:string { "plejliste" } - - searchByTextLabel:string { "Traži po" } - - partialOperatorDisplay:string { "sadrži" } - prefixOperatorDisplay:string { "počinje sa" } - =OperatorDisplay:string { "jednako" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Program Uživo" } - - playMenuItem:string { "Pusti" } - cueMenuItem:string { "Proba" } - addToPlaylistMenuItem:string { "Dodaj u plejlistu" } - removeMenuItem:string { "Ukloni" } - editPlaylistMenuItem:string { "Uredi plejlistu" } - schedulePlaylistMenuItem:string { "Programiraj plejlistu" } - exportPlaylistMenuItem:string { "Prebaci plejlistu" } - uploadToHubMenuItem:string { "Uputi na centralni server" } - - cuePlayerLabel:string { "Proba" } - autoPlayNextLabel:string { "#Play the next item automatically#" } - - clearListButtonLabel:string { "Očisti listu" } - removeButtonLabel:string { "Ukloni" } - - cannotEditPlaylistMsg:string - { "Neuspelo otvaranje plejliste." } - } - - optionsWindow:table - { - windowTitle:string { "Opcije" } - - needToRestartMsg:string { "Neophodno je restartartovati " - "aplikaciju\nkako bi nove postavke " - "uspele." } - errorMsg:string { "Neuspelo čuvanje opcija: " } - - soundSectionLabel:string { "Zvuk" } - keyBindingsSectionLabel:string { "Prečice na tastaturi" } - serversSectionLabel:string { "Serveri" } - schedulerSectionLabel:string { "Raspored emitovanja" } - backupSectionLabel:string { "Bekap" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "O aplikaciji" } - - cancelButtonLabel:string { "Otkaži" } - applyButtonLabel:string { "Primeni" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Kartica za predslušavanje:" } - outputDeviceLabel:string { "Kartica za emitovanje: " } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Pritisnite dugme..." } - keyBindingsInstructionsText:string - { "Kliknite dva puta na prečicu koju " - "želite,\nzatim pritisnite taster za " - "novu prečicu\n" - "(ili pritisnite escape kako biste " - "poništili operaciju)." } - - authenticationLabel:string { "Server za autentifikaciju" } - storageLabel:string { "Server za pohranjivanje" } - schedulerLabel:string { "Server za raspored emitovanja" } - serverLabel:string { "adresa:" } - portLabel:string { "port:" } - pathLabel:string { "putanja:" } - - schedulerStatusText:string { "Raspored emitovanja je" } - schedulerRunningStatus:string { "u toku." } - schedulerStoppedStatus:string { "zaustavljen." } - schedulerStartButtonLabel:string { "Počni"} - schedulerStopButtonLabel:string { "Završi" } - - reportBugsToText:string { "Prijavi greške: {0}" } - } - - backupView:table - { - workingStatus:string { "U toku..." } - successStatus:string { "Spremno"} - faultStatus:string { "Greška: {0}" } - - titleColumnLabel:string { "Naslov" } - dateColumnLabel:string { "Datum" } - statusColumnLabel:string { "Status" } - - mtimeTextLabel:string { "#Modified since:#" } - chooseTimeButtonLabel:string { "Izaberi vreme" } - resetTimeButtonLabel:string { "Reset" } - - backupButtonLabel:string { "Bekap" } - deleteButtonLabel:string { "Izbriši" } - saveButtonLabel:string { "Sačuvaj" } - - backupTitleLabel:string { "Bekap:" } - defaultBackupTitle:string { "novi bekap" } - - fileChooserDialogTitle:string { "Sačuvaj fajl" } - backupErrorMsg:string { "Greška u bekapu: " } - } - - rdsView:table - { - deviceLabel:string { "Serijski port:" } - PSrdsLabel:string { "Ime stanice:" } - PIrdsLabel:string { "Šifra stanice:" } - RTrdsLabel:string { "Informacija o klipu:" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Odaberite datum i vreme" } - - cancelButtonLabel:string { "Otkaži" } - okButtonLabel:string { "OK" } - - hourLabel:string { "sat:" } - minuteLabel:string { "minut:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Prebaci plejlistu" } - - playlistTitleLabel:string { "Naslov:" } - formatLabel:string { "Prebaci kao:" } - - cancelButtonLabel:string { "Otkaži" } - saveButtonLabel:string { "Sačuvaj" } - - internalFormatName:string { "Campcaster arhiva" } - smilFormatName:string { "tar koji sadrži SMIL" } - - fileChooserDialogTitle:string { "Sačuvaj fajl" } - - createExportErrorMsg:string { "Neuspelo prebacivanje plejliste:" } - - saveExportErrorMsg:string { "Neuspelo čuvanje prebačene plejliste." } - } - - transportList:table - { - workingStatus:string { "U toku..." } - successStatus:string { "Spremno" } - faultStatus:string { "Greška: {0}" } - - titleColumnLabel:string { "Naslov" } - dateColumnLabel:string { "Datum" } - statusColumnLabel:string { "Status" } - - cancelUploadMenuItem:string { "Otkaži upućivanje" } - cancelDownloadMenuItem:string { "Otkaži preuzimanje" } - - cannotCancelTransportMsg:string { "Neuspelo otkazivanje." } - duplicateFileMsg:string { "Fajl je već na centralnom " - "serveru." } - } - - restoreBackupWindow:table - { - windowTitle:string { "Povrati bekap" } - errorMessage:string { "Greška: {0}" } - pendingMessage:string { "#Uploading backup file\n''{0}''.\n#" - "Sačekajte..." } - finishedMessage:string { "Završeno upućivanje." } - } - - metadataTypes:table - { - title:string { "Naziv" } - creator:string { "Autor" } - album:string { "Album" } - year:string { "Godina" } - genre:string { "Žanr" } - description:string { "Opis" } - format:string { "Format" } - length:string { "Dužina" } - bpm:string { "BPM" } - rating:string { "Ocena" } - encoded_by:string { "Enkodirao" } - track_number:string { "Redni broj snimka" } - disc_number:string { "Redni broj diska" } - mood:string { "Raspoloženje" } - publishing_label:string { "Izdavačka kuća" } - composer:string { "Kompozitor" } - bitrate:string { "Bitrejt" } - channels:string { "Broj kanala" } - sample_rate:string { "Brzina uzorkovanja" } - encoding_software:string { "Enkoder" } - checksum:string { "Kompletna kontrola" } - lyrics:string { "Tekst pesme" } - orchestra_or_band:string { "Orkestar ili bend" } - conductor:string { "Dirigent" } - lyricist:string { "Tekstopisac" } - original_lyricist:string { "Originalni tekstopisac" } - radio_station_name:string { "Ime radio stanice" } - audio_file_info_url:string { "Web strana sa informacijama o fajlu" } - artist_url:string { "Web strana izvođača" } - audio_source_url:string { "Web strana izvora" } - radio_station_url:string { "Web strana radio stanice" } - buy_cd_url:string { "Kupi CD preko web strane" } - isrc_number:string { "ISRC broj" } - catalog_number:string { "Kataloški broj" } - original_artist:string { "Originalni izvođač" } - copyright:string { "Autorska prava" } - report_date_time:string { "#Report date/time#" } - report_location:string { "#Report location#" } - report_organizations:string { "#Report organizations#" } - subject:string { "#Subject#" } - } - - keyboardShortcuts:table - { - playAudio:string { "Play" } - pauseAudio:string { "Pause" } - stopAudio:string { "Stop" } - nextTrack:string { "Sledeć track" } - fadeOut:string { "Fade out" } - moveItemUp:string { "Pomeri gore" } - moveItemDown:string { "Pomeri dole" } - removeItem:string { "Ukloni" } - } -} - diff --git a/src/products/gLiveSupport/var/sr_CS_CYRILLIC.txt b/src/products/gLiveSupport/var/sr_CS_CYRILLIC.txt deleted file mode 100644 index 76504141e..000000000 --- a/src/products/gLiveSupport/var/sr_CS_CYRILLIC.txt +++ /dev/null @@ -1,460 +0,0 @@ -sr_CS_CYRILLIC:table -{ - cancelButtonLabel:string { "Откажи" } - noButtonLabel:string { "Не" } - yesButtonLabel:string { "Да" } - okButtonLabel:string { "ОК" } - - localeNotAvailableMsg:string { "Место {0} није доступно" } - schedulerNotReachableMsg:string { "Сервер са распоредом није доступан" } - storageNotReachableMsg:string { "Сервер није доступан" } - authenticationNotReachableMsg:string - { "Сервер за аутентизацију није доступан.\n" - "Да ли бисте желели да промените серверске поставке?" } - audioErrorMsg { "Грешка у аудио плејеру: " } - - masterPanelWindow:table - { - windowTitle:string { "Главни панел" } - - notLoggedInMsg:string { "Нисте пријављени" } - loggedInMsg:string { "Пријављени: {0}" } - loginButtonLabel:string { "Пријава" } - logoutButtonLabel:string { "Одјава" } - liveModeButtonLabel:string { "Уживо" } - uploadFileButtonLabel:string { "Аплоуд" } - scratchpadButtonLabel:string { "Припрема" } - playlistButtonLabel:string { "Плеј листа" } - schedulerButtonLabel:string { "Распоред" } - searchButtonLabel:string { "Претрага" } - optionsButtonLabel:string { "Опције" } - - elapsedTimeLabel:string { "позиција" } - remainingTimeLabel:string { "преостало" } - - sureToExitMsg:string { "Сигурно желите да изађете?" } - } - - loginWindow:table - { - windowTitle:string { "ПРИЈАВА" } - - userNameLabel:string { "Пријави се" } - passwordLabel:string { "Лозинка" } - languageLabel:string { "#Language#" } - - pleaseWaitMsg:string { "Пријава је у току, сачекајте" } - } - - audioClipListWindow:table - { - windowTitle:string { "Аудио Клипови" } - - idColumnLabel:string { "ид" } - lengthColumnLabel:string { "дужина" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "преузето" } - - closeButtonLabel:string { "затвори" } - } - - scratchpadWindow:table - { - windowTitle:string { "Припрема" } - - creatorColumnLabel:string { "Аутор" } - titleColumnLabel:string { "Наслов" } - addToPlaylistButtonLabel:string { "Додај у плеј листу" } - clearListButtonLabel:string { "Обриши листу" } - removeButtonLabel:string { "Уклони из листе" } - - cueMenuItem:string { "Проба" } - addToLiveModeMenuItem:string { "Додај у Програм Уживо" } - addToPlaylistMenuItem:string { "Додај у плеј листу" } - removeMenuItem:string { "Уклони" } - editPlaylistMenuItem:string { "Уреди плеј листу" } - schedulePlaylistMenuItem:string { "Програмирај плеј листу" } - exportPlaylistMenuItem:string { "Пребаци плејлисту" } - uploadToHubMenuItem:string { "Упути на централни сервер" } - - cannotEditPlaylistMsg:string { "Неуспело отварање плејлисте" } - } - - playlistListWindow:table - { - windowTitle:string { "Плеј листа" } - - listBoxLabel { "Плеј листе" } - detailBoxLabel { "Детаљи плеј листе" } - - idColumnLabel:string { "ид" } - lengthColumnLabel:string { "дужина" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "преузето" } - - closeButtonLabel:string { "затвори" } - } - - uploadFileWindow:table - { - windowTitle:string { "Аплоуд фајла" } - - chooseFileLabel:string { "Име фајла" } - chooseFileButtonLabel:string { "Претражи" } - - mainSectionLabel:string { "Главно" } - musicSectionLabel:string { "Музика" } - voiceSectionLabel:string { "Глас" } - - lengthLabel:string { "Трајање" } - - uploadButtonLabel:string { "Упути" } - closeButtonLabel:string { "Откажи" } - - fileChooserDialogTitle:string { "Изабери фајл" } - fileUploadedMsg:string { "Упућен фајл ''{0}''." } - couldNotOpenFileMsg:string { "Фајл се не може отворити." } - - couldNotReadLengthMsg:string { "Неуспело одређивање дужине." } - - unsupportedFileTypeMsg:string { "Неподржавана екстензија." } - missingTitleMsg:string { "Унесите наслов." } - badMetadataMsg:string { "Грешка у подацима за {0}." } - duplicateFileMsg:string { "Грешка:фајл је већ у архиви." } - } - - playlistWindow:table - { - windowTitle:string { "Плеј листа" } - - startColumnLabel:string { "почни" } - titleColumnLabel:string { "наслов" } - lengthColumnLabel:string { "дужина" } - fadeInColumnLabel:string { "Фејд ин" } - fadeOutColumnLabel:string { "Фејд аут" } - - nameLabel:string { "Име" } - lengthLabel:string { "#Duration:#" } - saveButtonLabel:string { "Сачувај" } - closeButtonLabel:string { "Затвори" } - lockFadesCheckButtonLabel:string - { "Подеси фејд аут тако да прати фејд ин" } - - playlistSavedMsg:string { "Сачувана плеј листа {0}." } - savePlaylistDialogMsg:string { "Сачувати плејлисту?" } - closeWithoutSavingButtonLabel:string - { "#Close without Saving#" } - emptyTitleErrorMsg:string { "Унесите наслов." } - } - - schedulerWindow:table - { - windowTitle:string { "Распоред" } - - scheduleTab:string { "Распоред емитовања" } - statusTab:string { "Статус" } - - startColumnLabel:string { "почетак" } - titleColumnLabel:string { "назив" } - endColumnLabel:string { "крај" } - deleteMenuItem:string { "Обриши" } - - stopCurrentlyPlayingButtonLabel:string { "Стоп" } - stopCurrentlyPlayingText:string { "тренутно се налази у " - "распореду емитовања" } - stopCurrentlyPlayingDialogMsg:string { "Да ли сте сигурни?" } - - closeButtonLabel:string { "Затвори" } - - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Програмирање Плеј Листе" } - - hourLabel:string { "сат: " } - minuteLabel:string { "минут: " } - secondLabel:string { "секунде: " } - scheduleButtonLabel:string { "програмирај" } - closeButtonLabel:string { "затвори" } - } - - searchWindow:table - { - windowTitle:string { "Претрага/Преглед" } - - searchWhereLabel:string { "Тражи или прегледај на: " } - searchWhereLocal:string { "локална архива" } - searchWhereRemote:string { "централни сервер" } - - simpleSearchTab:string { "Претрага" } - advancedSearchTab:string { "Напредна претрага" } - browseTab:string { "Преглед" } - transportsTab:string { "Пренеси" } - - searchButtonLabel:string { "Претражи" } - backwardButtonLabel:string { "⇦ Претходно" } - forwardButtonLabel:string { "Следеће ⇨" } - searchResultsCountLabel:string { "{0}-{1} од {2} резултата" } - - typeColumnLabel:string { "Тип" } - titleColumnLabel:string { "Наслов" } - creatorColumnLabel:string { "Аутор" } - sourceColumnLabel:string { "Албум" } - lengthColumnLabel:string { "Дужина" } - - allStringForBrowse { "--- све ---" } - - addToScratchpadMenuItem:string { "Додај у Припрему " } - addToPlaylistMenuItem:string { "Додај у плејлисту" } - addToLiveModeMenuItem:string { "Додај у Програм Уживо" } - editPlaylistMenuItem:string { "Уреди плејлисту" } - schedulePlaylistMenuItem:string { "Направи распоред плејлисте" } - exportPlaylistMenuItem:string { "Пребаци плејлисту" } - uploadToHubMenuItem:string { "Упути на централни сервер" } - downloadFromHubMenuItem:string { "Преузми са централног сервера" } - - pleaseWaitMsg:string { "Сачекајте..." } - shortErrorMsg:string { "Неуспела претрага." } - longErrorMsg:string { "Неуспела претрага: {0}." } - uploadToHubErrorMsg:string { "Неуспело упућивање на централни сервер: {0}." } - downloadFromHubErrorMsg:string { "Неуспело преузимање са централног сервера: {0}." } - nothingFoundMsg:string { "Фајлови нису нађени." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "Тип фајла" } - allFileType:string { "Сви" } - audioClipFileType:string { "аудио клипови" } - playlistFileType:string { "плејлисте" } - - searchByTextLabel:string { "Тражи по" } - - partialOperatorDisplay:string { "садржи" } - prefixOperatorDisplay:string { "почиње са" } - =OperatorDisplay:string { "једнако" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Програм Уживо" } - - playMenuItem:string { "Пусти" } - cueMenuItem:string { "Проба" } - addToPlaylistMenuItem:string { "Додај у плејлисту" } - removeMenuItem:string { "Уклони" } - editPlaylistMenuItem:string { "Уреди плејлисту" } - schedulePlaylistMenuItem:string { "Програмирај плејлисту" } - exportPlaylistMenuItem:string { "Пребаци плејлисту" } - uploadToHubMenuItem:string { "Упути на централни сервер" } - - cuePlayerLabel:string { "Проба" } - autoPlayNextLabel:string { "#Play the next item automatically#" } - - clearListButtonLabel:string { "Очисти листу" } - removeButtonLabel:string { "Уклони" } - - cannotEditPlaylistMsg:string - { "Неуспело отварање плејлисте." } - } - - optionsWindow:table - { - windowTitle:string { "Опције" } - - needToRestartMsg:string { "Неопходно је рестартартовати " - "апликацију\nкако би нове поставке " - "успеле." } - errorMsg:string { "Неуспело чување опција: " } - - soundSectionLabel:string { "Звук" } - keyBindingsSectionLabel:string { "Пречице на тастатури" } - serversSectionLabel:string { "Сервери" } - schedulerSectionLabel:string { "Распоред емитовања" } - backupSectionLabel:string { "Бекап" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "О апликацији" } - - cancelButtonLabel:string { "Откажи" } - applyButtonLabel:string { "Примени" } - okButtonLabel:string { "ОК" } - - cueDeviceLabel:string { "Картица за предслушавање:" } - outputDeviceLabel:string { "Картица за емитовање: " } - testButtonLabel:string { "Тест" } - - pressAKeyMsg:string { "Притисните дугме..." } - keyBindingsInstructionsText:string - { "Кликните два пута на пречицу коју " - "желите,\nзатим притисните тастер за " - "нову пречицу\n" - "(или притисните ескејп како бисте " - "поништили операцију)." } - - authenticationLabel:string { "Сервер за аутентификацију" } - storageLabel:string { "Сервер за похрањивање" } - schedulerLabel:string { "Сервер за распоред емитовања" } - serverLabel:string { "адреса:" } - portLabel:string { "порт:" } - pathLabel:string { "путања:" } - - schedulerStatusText:string { "Распоред емитовања је" } - schedulerRunningStatus:string { "у току." } - schedulerStoppedStatus:string { "заустављен." } - schedulerStartButtonLabel:string { "Почни"} - schedulerStopButtonLabel:string { "Заврши" } - - reportBugsToText:string { "Пријави грешке: {0}" } - } - - backupView:table - { - workingStatus:string { "У току..." } - successStatus:string { "Спремно"} - faultStatus:string { "Грешка: {0}" } - - titleColumnLabel:string { "Наслов" } - dateColumnLabel:string { "Датум" } - statusColumnLabel:string { "Статус" } - - mtimeTextLabel:string { "#Modified since:#" } - chooseTimeButtonLabel:string { "Изабери време" } - resetTimeButtonLabel:string { "Ресет" } - - backupButtonLabel:string { "Бекап" } - deleteButtonLabel:string { "Избриши" } - saveButtonLabel:string { "Сачувај" } - - backupTitleLabel:string { "Бекап:" } - defaultBackupTitle:string { "нови бекап" } - - fileChooserDialogTitle:string { "Сачувај фајл" } - backupErrorMsg:string { "Грешка у бекапу: " } - } - - rdsView:table - { - deviceLabel:string { "Серијски порт:" } - PSrdsLabel:string { "Име станице:" } - PIrdsLabel:string { "Шифра станице:" } - RTrdsLabel:string { "Информација о клипу:" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Одаберите датум и време" } - - cancelButtonLabel:string { "Откажи" } - okButtonLabel:string { "ОК" } - - hourLabel:string { "сат:" } - minuteLabel:string { "минут:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Пребаци плејлисту" } - - playlistTitleLabel:string { "Наслов:" } - formatLabel:string { "Пребаци као:" } - - cancelButtonLabel:string { "Откажи" } - saveButtonLabel:string { "Сачувај" } - - internalFormatName:string { "Цампцастер архива" } - smilFormatName:string { "тар који садржи СМИЛ" } - - fileChooserDialogTitle:string { "Сачувај фајл" } - - createExportErrorMsg:string { "Неуспело пребацивање плејлисте:" } - - saveExportErrorMsg:string { "Неуспело чување пребачене плејлисте." } - } - - transportList:table - { - workingStatus:string { "У току..." } - successStatus:string { "Спремно" } - faultStatus:string { "Грешка: {0}" } - - titleColumnLabel:string { "Наслов" } - dateColumnLabel:string { "Датум" } - statusColumnLabel:string { "Статус" } - - cancelUploadMenuItem:string { "Откажи упућивање" } - cancelDownloadMenuItem:string { "Откажи преузимање" } - - cannotCancelTransportMsg:string { "Неуспело отказивање." } - duplicateFileMsg:string { "Фајл је већ на централном " - "серверу." } - } - - restoreBackupWindow:table - { - windowTitle:string { "Поврати бекап" } - errorMessage:string { "Грешка: {0}" } - pendingMessage:string { "#Uploading backup file\n''{0}''.\n#" - "Сачекајте..." } - finishedMessage:string { "Завршено упућивање." } - } - - metadataTypes:table - { - title:string { "Назив" } - creator:string { "Аутор" } - album:string { "Албум" } - year:string { "Година" } - genre:string { "Жанр" } - description:string { "Опис" } - format:string { "Формат" } - length:string { "Дужина" } - bpm:string { "BPM" } - rating:string { "Оцена" } - encoded_by:string { "Енкодирао" } - track_number:string { "Редни број снимка" } - disc_number:string { "Редни број диска" } - mood:string { "Расположење" } - publishing_label:string { "Издавачка кућа" } - composer:string { "Композитор" } - bitrate:string { "Битрејт" } - channels:string { "Број канала" } - sample_rate:string { "Брзина узорковања" } - encoding_software:string { "Енкодер" } - checksum:string { "Комплетна контрола" } - lyrics:string { "Текст песме" } - orchestra_or_band:string { "Оркестар или бенд" } - conductor:string { "Диригент" } - lyricist:string { "Текстописац" } - original_lyricist:string { "Оригинални текстописац" } - radio_station_name:string { "Име радио станице" } - audio_file_info_url:string { "Веб страна са информацијама о фајлу" } - artist_url:string { "Веб страна извођача" } - audio_source_url:string { "Веб страна извора" } - radio_station_url:string { "Веб страна радио станице" } - buy_cd_url:string { "Купи ЦД преко веб стране" } - isrc_number:string { "ISRC број" } - catalog_number:string { "Каталошки број" } - original_artist:string { "Оригинални извођач" } - copyright:string { "Ауторска права" } - report_date_time:string { "#Report date/time#" } - report_location:string { "#Report location#" } - report_organizations:string { "#Report organizations#" } - subject:string { "#Subject#" } - } - - keyboardShortcuts:table - { - playAudio:string { "Плеј" } - pauseAudio:string { "Поуз" } - stopAudio:string { "Стоп" } - nextTrack:string { "Следећ трак" } - fadeOut:string { "Фејд аут" } - moveItemUp:string { "Помери горе" } - moveItemDown:string { "Помери доле" } - removeItem:string { "Уклони" } - } -} - diff --git a/src/products/gLiveSupport/var/stationLogo.png b/src/products/gLiveSupport/var/stationLogo.png deleted file mode 100644 index fba91b3cc..000000000 Binary files a/src/products/gLiveSupport/var/stationLogo.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/sv.txt b/src/products/gLiveSupport/var/sv.txt deleted file mode 100644 index 2fe6fd5fb..000000000 --- a/src/products/gLiveSupport/var/sv.txt +++ /dev/null @@ -1,467 +0,0 @@ -sv:table -{ - cancelButtonLabel:string { "Avbryt" } - noButtonLabel:string { "Nej" } - yesButtonLabel:string { "Ja" } - okButtonLabel:string { "OK" } - - localeNotAvailableMsg:string { "Lokal {0} är inte tillgänglig." } - schedulerNotReachableMsg:string { "Schemaläggarens server är inte tillgänglig." } - storageNotReachableMsg:string { "Lagringsservern är inte tillgänglig." } - authenticationNotReachableMsg:string - { "Autentiseringsservern är inte " - "tillgänglig.\n" - "Vill du redigera serverns " - "inställningar?" } - audioErrorMsg { "Ljudspelarfel: " } - - masterPanelWindow:table - { - windowTitle:string { "Huvudpanel" } - - notLoggedInMsg:string { "Inte inloggad" } - loggedInMsg:string { "Använd: {0}" } - loginButtonLabel:string { "Logga in" } - logoutButtonLabel:string { "Logga ut" } - liveModeButtonLabel:string { "Liveläge" } - uploadFileButtonLabel:string { "Ladda upp" } - scratchpadButtonLabel:string { "Kladdblock" } - playlistButtonLabel:string { "Spellista" } - schedulerButtonLabel:string { "Schemalägg" } - searchButtonLabel:string { "Sök" } - optionsButtonLabel:string { "Val" } - - elapsedTimeLabel:string { "förflutet" } - remainingTimeLabel:string { "återstår" } - - sureToExitMsg:string { "Verkligen avsluta?" } - } - - loginWindow:table - { - windowTitle:string { "Logga in" } - - userNameLabel:string { "Användare" } - passwordLabel:string { "Lösenord" } - languageLabel:string { "Språk" } - - pleaseWaitMsg:string { "Loggar in, vänta." } - } - - audioClipListWindow:table - { - windowTitle:string { "Ljudfilslista" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "längd" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "tecken" } - - closeButtonLabel:string { "stäng" } - } - - scratchpadWindow:table - { - windowTitle:string { "Kladdblock" } - - creatorColumnLabel:string { "Skapare" } - titleColumnLabel:string { "Titel" } - addToPlaylistButtonLabel:string { "Till spellista" } - clearListButtonLabel:string { "Töm lista" } - removeButtonLabel:string { "Avlägsna poster" } - - cueMenuItem:string { "Förhandskoll" } - addToLiveModeMenuItem:string { "Lägg till i _Liveläge" } - addToPlaylistMenuItem:string { "Lägg till i _Spellista" } - removeMenuItem:string { "_Avlägsna" } - editPlaylistMenuItem:string { "_Redigera Spellista" } - schedulePlaylistMenuItem:string { "S_chemalägg Spellista" } - exportPlaylistMenuItem:string { "E_xportera Spellista" } - uploadToHubMenuItem:string { "Ladda upp till nätverksnav" } - - cannotEditPlaylistMsg:string - { "Kunde inte öppna spellista för redigering." } - } - - playlistListWindow:table - { - windowTitle:string { "Spellista" } - - listBoxLabel { "Spellistor" } - detailBoxLabel { "Spellistedetaljer" } - - idColumnLabel:string { "id" } - lengthColumnLabel:string { "längd" } - uriColumnLabel:string { "URI" } - tokenColumnLabel:string { "tecken" } - - closeButtonLabel:string { "stäng" } - } - - uploadFileWindow:table - { - windowTitle:string { "Ladda upp fil" } - - chooseFileLabel:string { "Filnamn" } - chooseFileButtonLabel:string { "Bläddra" } - - mainSectionLabel:string { "Huvud" } - musicSectionLabel:string { "Musik" } - voiceSectionLabel:string { "Röst" } - - lengthLabel:string { "Längd" } - - uploadButtonLabel:string { "Ladda upp" } - closeButtonLabel:string { "Avbryt" } - - fileChooserDialogTitle:string { "Öppna fil" } - fileUploadedMsg:string { "Laddade upp ''{0}''." } - couldNotOpenFileMsg:string { "Filen kunde inte öppnas." } - couldNotReadLengthMsg:string { "Kunde inte avgöra ljudfilens " - "längd." } - unsupportedFileTypeMsg:string { "Ostödd filtyp." } - missingTitleMsg:string { "Ange en titel." } - badMetadataMsg:string { "Ogiltigt data för {0}." } - duplicateFileMsg:string { "Fel: filen finns lagrad " - "redan." } - } - - playlistWindow:table - { - windowTitle:string { "Redigera spellista" } - - startColumnLabel:string { "Start" } - titleColumnLabel:string { "Titel" } - lengthColumnLabel:string { "Längd" } - fadeInColumnLabel:string { "Tona in" } - fadeOutColumnLabel:string { "Tona ut" } - - nameLabel:string { "Namn" } - lengthLabel:string { "Längd:" } - saveButtonLabel:string { "Spara" } - closeButtonLabel:string { "Stäng" } - lockFadesCheckButtonLabel:string - { "Lås uttoning till följande intoning" } - - upMenuItem:string { "Flytta _Upp" } - downMenuItem:string { "Flytta _Ner" } - removeMenuItem:string { "_Avlägsna" } - - playlistSavedMsg:string { "Sparad spellista ''{0}''." } - savePlaylistDialogMsg:string { "Vill du spara spellistan?" } - closeWithoutSavingButtonLabel:string - { "Stäng utan att spara" } - emptyTitleErrorMsg:string { "Ange en titel." } - } - - schedulerWindow:table - { - windowTitle:string { "Schemaläggare" } - - scheduleTab:string { "Schema" } - statusTab:string { "Läge" } - - startColumnLabel:string { "start" } - titleColumnLabel:string { "titel" } - endColumnLabel:string { "slut" } - deleteMenuItem:string { "_Ta bort" } - - stopCurrentlyPlayingButtonLabel:string { "Stopp" } - stopCurrentlyPlayingText:string { "Spelas just nu " - "i schemaläggaren." } - stopCurrentlyPlayingDialogMsg:string { "Är du säker?" } - - closeButtonLabel:string { "Stäng" } - } - - schedulePlaylistWindow:table - { - windowTitle:string { "Schemalägg spellista" } - - hourLabel:string { "timme: " } - minuteLabel:string { "minut: " } - secondLabel:string { "sekund: " } - scheduleButtonLabel:string { "schema" } - closeButtonLabel:string { "stäng" } - } - - searchWindow:table - { - windowTitle:string { "Sök/Bläddra" } - - searchWhereLabel:string { "Sök, Bläddra på: " } - searchWhereLocal:string { "lokal enhet" } - searchWhereRemote:string { "nätverksnav" } - - simpleSearchTab:string { "Sök" } - advancedSearchTab:string { "Avancerad Sökning" } - browseTab:string { "Bläddra" } - transportsTab:string { "Överföringar" } - - searchButtonLabel:string { "Sök" } - backwardButtonLabel:string { "⇦ Innan" } - forwardButtonLabel:string { "Nästa ⇨" } - searchResultsCountLabel:string { "{0}-{1} av {2} resultat" } - - typeColumnLabel:string { "Typ" } - titleColumnLabel:string { "Titel" } - creatorColumnLabel:string { "Skapare" } - sourceColumnLabel:string { "Album" } - lengthColumnLabel:string { "Längd" } - - allStringForBrowse { "--- allt ---" } - - addToScratchpadMenuItem:string { "Lägg till i _Kladdblock" } - addToPlaylistMenuItem:string { "Lägg till i _Spellista" } - addToLiveModeMenuItem:string { "Lägg till i _Liveläge" } - editPlaylistMenuItem:string { "_Redigera Spellista" } - schedulePlaylistMenuItem:string { "S_chemalägg Spellista" } - exportPlaylistMenuItem:string { "E_xportera Spellista" } - uploadToHubMenuItem:string { "Ladda upp till nätverksnav" } - downloadFromHubMenuItem:string { "Ladda ner från nätverksnav" } - - pleaseWaitMsg:string { "Vänta..." } - shortErrorMsg:string { "Sökning misslyckades." } - longErrorMsg:string { "Sökning misslyckades: {0}." } - uploadToHubErrorMsg:string { "Uppladdning till nav misslyckades: {0}." } - downloadFromHubErrorMsg:string { "Nerladdning från nav misslyckades: {0}." } - nothingFoundMsg:string { "Fann inga filer." } - } - - advancedSearchEntry:table - { - fileTypeTextLabel:string { "Filtyper" } - allFileType:string { "alla" } - audioClipFileType:string { "ljudfiler" } - playlistFileType:string { "spellistor" } - - searchByTextLabel:string { "Sök enligt" } - - partialOperatorDisplay:string { "innehåller" } - prefixOperatorDisplay:string { "börjar med" } - =OperatorDisplay:string { "lika med" } - <=OperatorDisplay:string { "<=" } - >=OperatorDisplay:string { ">=" } - } - - liveModeWindow:table - { - windowTitle:string { "Liveläge" } - - playMenuItem:string { "S_pela" } - cueMenuItem:string { "_Förhandskoll" } - addToPlaylistMenuItem:string { "Lägg till i _Spellista" } - removeMenuItem:string { "_Avlägsna" } - editPlaylistMenuItem:string { "_Redigera Spellista" } - schedulePlaylistMenuItem:string { "S_chemalägg Spellista" } - exportPlaylistMenuItem:string { "E_xportera Spellista" } - uploadToHubMenuItem:string { "Ladda upp till nätverksnav" } - - cuePlayerLabel:string { "Förhandskoll" } - autoPlayNextLabel:string { "spela nästa automatiskt" } - - clearListButtonLabel:string { "Rensa listan" } - removeButtonLabel:string { "Avlägsna post(er)" } - - cannotEditPlaylistMsg:string - { "Kunde inte öppna spellistan för redigering." } - } - - optionsWindow:table - { - windowTitle:string { "Val" } - - needToRestartMsg:string { "Du måste starta om programmet " - "för att\nde nya inställningarna " - "ska verkställas." } - errorMsg:string { "Kunde inte spara valen: " } - - soundSectionLabel:string { "Ljud" } - keyBindingsSectionLabel:string { "Kortkommandon" } - serversSectionLabel:string { "Servrar" } - schedulerSectionLabel:string { "Schemaläggare" } - backupSectionLabel:string { "Backup" } - rdsSectionLabel:string { "RDS" } - aboutSectionLabel:string { "Om" } - - cancelButtonLabel:string { "Avbryt" } - applyButtonLabel:string { "Verkställ" } - okButtonLabel:string { "OK" } - - cueDeviceLabel:string { "Förhandsljudenhet:" } - outputDeviceLabel:string { "Livelägeljudenhet:" } - testButtonLabel:string { "Test" } - - pressAKeyMsg:string { "Tryck en tangent..." } - keyBindingsInstructionsText:string - { "Dubbelklicka på den genväg du vill " - "ändra, \n" - "tryck sen tangenten för den nya " - "genvägen\n" - "(eller tryck Escape-tangenten för " - "att avbryta)." } - - authenticationLabel:string { "Autentiseringsserver" } - storageLabel:string { "Lagringsserver" } - schedulerLabel:string { "Schemaläggningsserver" } - serverLabel:string { "adress:" } - portLabel:string { "port:" } - pathLabel:string { "sökväg:" } - - schedulerStatusText:string { "Schemaläggaren" } - schedulerRunningStatus:string { "körs." } - schedulerStoppedStatus:string { "körs ej." } - schedulerStartButtonLabel:string { "Start" } - schedulerStopButtonLabel:string { "Stopp" } - - reportBugsToText:string { "Rapportera buggar till: {0}" } - creditsText:import { "../../../../CREDITS" } - } - - backupView:table - { - workingStatus:string { "På gång..." } - successStatus:string { "Klart" } - faultStatus:string { "Fel: {0}" } - - titleColumnLabel:string { "Titel" } - dateColumnLabel:string { "Datum" } - statusColumnLabel:string { "Läge" } - - mtimeTextLabel:string { "Ändrad sedan:" } - chooseTimeButtonLabel:string { "Välj tid" } - resetTimeButtonLabel:string { "Återställ" } - - backupButtonLabel:string { "Backup" } - deleteButtonLabel:string { "Ta bort" } - saveButtonLabel:string { "Spara" } - - backupTitleLabel:string { "Titel:" } - defaultBackupTitle:string { "ny backup" } - - fileChooserDialogTitle:string { "spara fil" } - backupErrorMsg:string { "Backup-fel: " } - } - - rdsView:table - { - deviceLabel:string { "Serieport:" } - PSrdsLabel:string { "Stationsnamn:" } - PIrdsLabel:string { "Stationskod:" } - RTrdsLabel:string { "Ljudfilsinfo:" } - } - - dateTimeChooserWindow:table - { - windowTitle:string { "Välj datum och tid" } - - cancelButtonLabel:string { "Avbryt" } - okButtonLabel:string { "OK" } - - hourLabel:string { "timme:" } - minuteLabel:string { "minut:" } - } - - exportPlaylistWindow:table - { - windowTitle:string { "Exportera Spellista" } - - playlistTitleLabel:string { "Titel:" } - formatLabel:string { "Exportera som:" } - - cancelButtonLabel:string { "Avbryt" } - saveButtonLabel:string { "Spara" } - - internalFormatName:string { "Campcaster-arkiv" } - smilFormatName:string { "tar innehåller en SMIL" } - - fileChooserDialogTitle:string { "Spara Fil" } - - createExportErrorMsg:string { "Kunde inte exportera spellistan:" } - saveExportErrorMsg:string { "Kunde inte spara den exporterade spellistan." } - } - - transportList:table - { - workingStatus:string { "På gång..." } - successStatus:string { "Klart" } - faultStatus:string { "Fel: {0}" } - - titleColumnLabel:string { "Titel" } - dateColumnLabel:string { "Datum" } - statusColumnLabel:string { "Läge" } - - cancelUploadMenuItem:string { "Avbryt uppladdning" } - cancelDownloadMenuItem:string { "Avbryt nedladdning" } - - cannotCancelTransportMsg:string { "Avbrytning misslyckades: {0}." } - duplicateFileMsg:string { "filen finns i nätverks" - "navet redan." } - } - - restoreBackupWindow:table - { - windowTitle:string { "Återställ Backup" } - errorMessage:string { "Fel: {0}" } - pendingMessage:string { "Laddar upp backup-filen\n''{0}''.\n" - "Vänta..." } - finishedMessage:string { "Uppladdning färdig." } - } - - metadataTypes:table - { - title:string { "Titel" } - creator:string { "Skapare" } - album:string { "Album" } - year:string { "År" } - genre:string { "Genre" } - description:string { "Beskrivning" } - format:string { "Format" } - length:string { "Längd" } - bpm:string { "BPM" } - rating:string { "Kvalificering" } - encoded_by:string { "Kodad av" } - track_number:string { "Spårnummer" } - disc_number:string { "Skivnummer" } - mood:string { "Stämning" } - publishing_label:string { "Utgivande märke" } - composer:string { "Kompositör" } - bitrate:string { "Bithastighet" } - channels:string { "Kanaler" } - sample_rate:string { "Sampelhastighet" } - encoding_software:string { "Kodningsprogram" } - checksum:string { "Kontrollsumma" } - lyrics:string { "Text" } - orchestra_or_band:string { "Orkester eller band" } - conductor:string { "Dirigent" } - lyricist:string { "Textförfattare" } - original_lyricist:string { "Originaltextförfattare" } - radio_station_name:string { "Radiostationsnamn" } - audio_file_info_url:string { "Filinfowebbsida" } - artist_url:string { "Artist webbsida" } - audio_source_url:string { "Källans webbsida" } - radio_station_url:string { "Radiostationens webbsida" } - buy_cd_url:string { "Köpa-CD-webbsida" } - isrc_number:string { "ISRC-nummer" } - catalog_number:string { "Katalognummer" } - original_artist:string { "Originalartist" } - copyright:string { "Upphovsrätt" } - report_date_time:string { "Rapportera datum/tid" } - report_location:string { "Rapportera plats" } - report_organizations:string { "Rapportera organisationer" } - subject:string { "Ämne" } - } - - keyboardShortcuts:table - { - playAudio:string { "Spela" } - pauseAudio:string { "Paus" } - stopAudio:string { "Stopp" } - nextTrack:string { "Nästa spår" } - fadeOut:string { "Tona ut" } - moveItemUp:string { "Flytta upp post" } - moveItemDown:string { "Flytta ner post" } - removeItem:string { "Avlägsna post" } - } -} - diff --git a/src/products/gLiveSupport/var/testAudio.ogg b/src/products/gLiveSupport/var/testAudio.ogg deleted file mode 100644 index e8adff4b5..000000000 Binary files a/src/products/gLiveSupport/var/testAudio.ogg and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/bottom.png b/src/products/gLiveSupport/var/widgets/blueBin/bottom.png deleted file mode 100644 index dc9abc5a4..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/bottom.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/bottomLeft.png b/src/products/gLiveSupport/var/widgets/blueBin/bottomLeft.png deleted file mode 100644 index 71c70b859..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/bottomLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/bottomRight.png b/src/products/gLiveSupport/var/widgets/blueBin/bottomRight.png deleted file mode 100644 index 35a0dc83e..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/bottomRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/left.png b/src/products/gLiveSupport/var/widgets/blueBin/left.png deleted file mode 100644 index 38bb0f431..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/right.png b/src/products/gLiveSupport/var/widgets/blueBin/right.png deleted file mode 100644 index 730c9c3b7..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/top.png b/src/products/gLiveSupport/var/widgets/blueBin/top.png deleted file mode 100644 index df1c5d45a..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/top.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/topLeft.png b/src/products/gLiveSupport/var/widgets/blueBin/topLeft.png deleted file mode 100644 index 6fb4deb28..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/topLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/blueBin/topRight.png b/src/products/gLiveSupport/var/widgets/blueBin/topRight.png deleted file mode 100644 index 0ea6a2bb3..000000000 Binary files a/src/products/gLiveSupport/var/widgets/blueBin/topRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/center.png b/src/products/gLiveSupport/var/widgets/button/center.png deleted file mode 100644 index 3d708dbdf..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/center.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/centerGray.png b/src/products/gLiveSupport/var/widgets/button/centerGray.png deleted file mode 100644 index 3d708dbdf..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/centerGray.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/centerRoll.png b/src/products/gLiveSupport/var/widgets/button/centerRoll.png deleted file mode 100644 index 992df8040..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/centerRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/centerSel.png b/src/products/gLiveSupport/var/widgets/button/centerSel.png deleted file mode 100644 index 366729d6e..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/centerSel.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/left.png b/src/products/gLiveSupport/var/widgets/button/left.png deleted file mode 100644 index 206a23151..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/leftGray.png b/src/products/gLiveSupport/var/widgets/button/leftGray.png deleted file mode 100644 index 206a23151..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/leftGray.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/leftRoll.png b/src/products/gLiveSupport/var/widgets/button/leftRoll.png deleted file mode 100644 index 9906b8809..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/leftRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/leftSel.png b/src/products/gLiveSupport/var/widgets/button/leftSel.png deleted file mode 100644 index 51302ea92..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/leftSel.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/right.png b/src/products/gLiveSupport/var/widgets/button/right.png deleted file mode 100644 index 616eb6d94..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/rightGray.png b/src/products/gLiveSupport/var/widgets/button/rightGray.png deleted file mode 100644 index 616eb6d94..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/rightGray.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/rightRoll.png b/src/products/gLiveSupport/var/widgets/button/rightRoll.png deleted file mode 100644 index d5e2fffaa..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/rightRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/button/rightSel.png b/src/products/gLiveSupport/var/widgets/button/rightSel.png deleted file mode 100644 index f60b0d25d..000000000 Binary files a/src/products/gLiveSupport/var/widgets/button/rightSel.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/combo/center.png b/src/products/gLiveSupport/var/widgets/combo/center.png deleted file mode 100644 index 36bfc6d25..000000000 Binary files a/src/products/gLiveSupport/var/widgets/combo/center.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/combo/left.png b/src/products/gLiveSupport/var/widgets/combo/left.png deleted file mode 100644 index c6ec5de0f..000000000 Binary files a/src/products/gLiveSupport/var/widgets/combo/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/combo/right.png b/src/products/gLiveSupport/var/widgets/combo/right.png deleted file mode 100644 index d1df5fb57..000000000 Binary files a/src/products/gLiveSupport/var/widgets/combo/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/bottom.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/bottom.png deleted file mode 100644 index ea0428e3a..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/bottom.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/bottomLeft.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/bottomLeft.png deleted file mode 100644 index 55325d4e7..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/bottomLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/bottomRight.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/bottomRight.png deleted file mode 100644 index 3852da14a..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/bottomRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/left.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/left.png deleted file mode 100644 index d27061d9b..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/right.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/right.png deleted file mode 100644 index 7fcdc81b4..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/top.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/top.png deleted file mode 100644 index df1c5d45a..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/top.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/topLeft.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/topLeft.png deleted file mode 100644 index cd3f12159..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/topLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/darkBlueBin/topRight.png b/src/products/gLiveSupport/var/widgets/darkBlueBin/topRight.png deleted file mode 100644 index ba5b8556c..000000000 Binary files a/src/products/gLiveSupport/var/widgets/darkBlueBin/topRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/bottom.png b/src/products/gLiveSupport/var/widgets/entryBin/bottom.png deleted file mode 100644 index a1fcad540..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/bottom.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/bottomLeft.png b/src/products/gLiveSupport/var/widgets/entryBin/bottomLeft.png deleted file mode 100644 index 507b5ee9c..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/bottomLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/bottomRight.png b/src/products/gLiveSupport/var/widgets/entryBin/bottomRight.png deleted file mode 100644 index 80059ed43..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/bottomRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/left.png b/src/products/gLiveSupport/var/widgets/entryBin/left.png deleted file mode 100644 index a9a6f95de..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/right.png b/src/products/gLiveSupport/var/widgets/entryBin/right.png deleted file mode 100644 index 047fed107..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/top.png b/src/products/gLiveSupport/var/widgets/entryBin/top.png deleted file mode 100644 index abbdcd90b..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/top.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/topLeft.png b/src/products/gLiveSupport/var/widgets/entryBin/topLeft.png deleted file mode 100644 index b94750281..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/topLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/entryBin/topRight.png b/src/products/gLiveSupport/var/widgets/entryBin/topRight.png deleted file mode 100644 index 9b95fafba..000000000 Binary files a/src/products/gLiveSupport/var/widgets/entryBin/topRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/icons/audioClipIcon.png b/src/products/gLiveSupport/var/widgets/icons/audioClipIcon.png deleted file mode 100644 index f7adf90a8..000000000 Binary files a/src/products/gLiveSupport/var/widgets/icons/audioClipIcon.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/icons/playlistIcon.png b/src/products/gLiveSupport/var/widgets/icons/playlistIcon.png deleted file mode 100644 index 2f41a4678..000000000 Binary files a/src/products/gLiveSupport/var/widgets/icons/playlistIcon.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/delete.png b/src/products/gLiveSupport/var/widgets/imageButton/delete.png deleted file mode 100644 index 1919d297c..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/delete.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/deleteRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/deleteRoll.png deleted file mode 100644 index d6e7874a7..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/deleteRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/hugePlay.png b/src/products/gLiveSupport/var/widgets/imageButton/hugePlay.png deleted file mode 100644 index f1628edfe..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/hugePlay.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/hugePlayRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/hugePlayRoll.png deleted file mode 100644 index 55ea1ab2a..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/hugePlayRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/masterPause.png b/src/products/gLiveSupport/var/widgets/imageButton/masterPause.png deleted file mode 100644 index 910a2a8b9..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/masterPause.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/masterPauseRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/masterPauseRoll.png deleted file mode 100644 index 8e8d9bccf..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/masterPauseRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/masterPlay.png b/src/products/gLiveSupport/var/widgets/imageButton/masterPlay.png deleted file mode 100644 index e2ae165a7..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/masterPlay.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/masterPlayRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/masterPlayRoll.png deleted file mode 100644 index f01a765b0..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/masterPlayRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/masterStop.png b/src/products/gLiveSupport/var/widgets/imageButton/masterStop.png deleted file mode 100644 index d6db4a0a0..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/masterStop.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/masterStopRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/masterStopRoll.png deleted file mode 100644 index 8f7ecc0b0..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/masterStopRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/minus.png b/src/products/gLiveSupport/var/widgets/imageButton/minus.png deleted file mode 100644 index 1919d297c..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/minus.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/minusRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/minusRoll.png deleted file mode 100644 index d6e7874a7..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/minusRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/plus.png b/src/products/gLiveSupport/var/widgets/imageButton/plus.png deleted file mode 100644 index 1d38ca470..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/plus.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/plusRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/plusRoll.png deleted file mode 100644 index ba4fea1ac..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/plusRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/smallPause.png b/src/products/gLiveSupport/var/widgets/imageButton/smallPause.png deleted file mode 100644 index 215b61480..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/smallPause.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/smallPauseRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/smallPauseRoll.png deleted file mode 100644 index 66ea6401f..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/smallPauseRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/smallPlay.png b/src/products/gLiveSupport/var/widgets/imageButton/smallPlay.png deleted file mode 100644 index c45882ae9..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/smallPlay.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/smallPlayRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/smallPlayRoll.png deleted file mode 100644 index d628bd8c1..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/smallPlayRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/smallStop.png b/src/products/gLiveSupport/var/widgets/imageButton/smallStop.png deleted file mode 100644 index 54f4936ea..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/smallStop.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/smallStopRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/smallStopRoll.png deleted file mode 100644 index 31d29a19d..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/smallStopRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/windowClose.png b/src/products/gLiveSupport/var/widgets/imageButton/windowClose.png deleted file mode 100644 index 7d3761be3..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/windowClose.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/windowCloseRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/windowCloseRoll.png deleted file mode 100644 index bc4c7dabf..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/windowCloseRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/windowMax.png b/src/products/gLiveSupport/var/widgets/imageButton/windowMax.png deleted file mode 100644 index d95961b45..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/windowMax.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/windowMaxRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/windowMaxRoll.png deleted file mode 100644 index bcabbbb32..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/windowMaxRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/windowMin.png b/src/products/gLiveSupport/var/widgets/imageButton/windowMin.png deleted file mode 100644 index 4a4764db0..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/windowMin.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/imageButton/windowMinRoll.png b/src/products/gLiveSupport/var/widgets/imageButton/windowMinRoll.png deleted file mode 100644 index 2748d38fa..000000000 Binary files a/src/products/gLiveSupport/var/widgets/imageButton/windowMinRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/center.png b/src/products/gLiveSupport/var/widgets/tabButton/center.png deleted file mode 100644 index 8e2bcc061..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/center.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/centerGray.png b/src/products/gLiveSupport/var/widgets/tabButton/centerGray.png deleted file mode 100644 index 8e2bcc061..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/centerGray.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/centerRoll.png b/src/products/gLiveSupport/var/widgets/tabButton/centerRoll.png deleted file mode 100644 index a8c54dbe5..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/centerRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/centerSel.png b/src/products/gLiveSupport/var/widgets/tabButton/centerSel.png deleted file mode 100644 index e21584c1f..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/centerSel.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/left.png b/src/products/gLiveSupport/var/widgets/tabButton/left.png deleted file mode 100644 index f6eed0f8b..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/leftGray.png b/src/products/gLiveSupport/var/widgets/tabButton/leftGray.png deleted file mode 100644 index 1899b75bc..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/leftGray.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/leftRoll.png b/src/products/gLiveSupport/var/widgets/tabButton/leftRoll.png deleted file mode 100644 index 993f0d6e8..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/leftRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/leftSel.png b/src/products/gLiveSupport/var/widgets/tabButton/leftSel.png deleted file mode 100644 index ea3ca2bef..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/leftSel.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/right.png b/src/products/gLiveSupport/var/widgets/tabButton/right.png deleted file mode 100644 index 9ef7f0715..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/rightGray.png b/src/products/gLiveSupport/var/widgets/tabButton/rightGray.png deleted file mode 100644 index fda8122ed..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/rightGray.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/rightRoll.png b/src/products/gLiveSupport/var/widgets/tabButton/rightRoll.png deleted file mode 100644 index db4fec223..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/rightRoll.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/tabButton/rightSel.png b/src/products/gLiveSupport/var/widgets/tabButton/rightSel.png deleted file mode 100644 index 40ab33045..000000000 Binary files a/src/products/gLiveSupport/var/widgets/tabButton/rightSel.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/bottom.png b/src/products/gLiveSupport/var/widgets/whiteWindow/bottom.png deleted file mode 100644 index b177658af..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/bottom.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/bottomLeft.png b/src/products/gLiveSupport/var/widgets/whiteWindow/bottomLeft.png deleted file mode 100644 index bd9231441..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/bottomLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/bottomRight.png b/src/products/gLiveSupport/var/widgets/whiteWindow/bottomRight.png deleted file mode 100644 index eb9afc633..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/bottomRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/left.png b/src/products/gLiveSupport/var/widgets/whiteWindow/left.png deleted file mode 100644 index 4ff356163..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/left.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/resize.png b/src/products/gLiveSupport/var/widgets/whiteWindow/resize.png deleted file mode 100644 index bd585bb87..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/resize.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/right.png b/src/products/gLiveSupport/var/widgets/whiteWindow/right.png deleted file mode 100644 index b676e704f..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/right.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/top.png b/src/products/gLiveSupport/var/widgets/whiteWindow/top.png deleted file mode 100644 index d2d5906b5..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/top.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/topLeft.png b/src/products/gLiveSupport/var/widgets/whiteWindow/topLeft.png deleted file mode 100644 index 5d8b8f67a..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/topLeft.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/topRight.png b/src/products/gLiveSupport/var/widgets/whiteWindow/topRight.png deleted file mode 100644 index d474ba11b..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/topRight.png and /dev/null differ diff --git a/src/products/gLiveSupport/var/widgets/whiteWindow/windowTitleLogo.png b/src/products/gLiveSupport/var/widgets/whiteWindow/windowTitleLogo.png deleted file mode 100644 index 4aa64a212..000000000 Binary files a/src/products/gLiveSupport/var/widgets/whiteWindow/windowTitleLogo.png and /dev/null differ diff --git a/src/products/scheduler/bin/autogen.sh b/src/products/scheduler/bin/autogen.sh deleted file mode 100755 index 30f4c7f7a..000000000 --- a/src/products/scheduler/bin/autogen.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="Scheduler" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -echo " aclocal $ACLOCAL_FLAGS" -cp -f ${configure_ac} ${tmpdir} -cp -f ${etcdir}/acinclude.m4 ${tmpdir} -aclocal $ACLOCAL_FLAGS - -echo " autoheader ${configure_ac}" -autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/products/scheduler/bin/campcaster-scheduler.sh b/src/products/scheduler/bin/campcaster-scheduler.sh deleted file mode 100755 index 4a647ab75..000000000 --- a/src/products/scheduler/bin/campcaster-scheduler.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash -#-------------------------------------------------------------------------------# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# System V runlevel style invoke script for the Campcaster Scheduler -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -libdir=$basedir/lib -vardir=$basedir/var/Campcaster/scheduler/var - - -#------------------------------------------------------------------------------- -# Set up the environment -#------------------------------------------------------------------------------- -export LD_LIBRARY_PATH=$libdir:$LD_LIBRARY_PATH -export GST_REGISTRY=$etcdir/gst-registry.xml -scheduler_exe=$bindir/campcaster-scheduler - -if [ -f ~/.campcaster/campcaster-scheduler.xml ]; then - config_file=~/.campcaster/campcaster-scheduler.xml -elif [ -f $etcdir/campcaster-scheduler.xml ]; then - config_file=$etcdir/campcaster-scheduler.xml -else - echo "Can't find configuration file."; -fi - -mode=$1 - - -#------------------------------------------------------------------------------- -# Do what the user asks us to do -#------------------------------------------------------------------------------- -case "$mode" in - 'start') - echo "Starting the Campcaster scheduler..." - $scheduler_exe -c $config_file start - sleep 2 - ;; - - 'stop') - echo "Stopping the Campcaster scheduler..." - $scheduler_exe -c $config_file stop - sleep 2 - ;; - - 'restart') - echo "Stopping the Campcaster scheduler..." - $scheduler_exe -c $config_file stop - sleep 2 - echo "Starting the Campcaster scheduler..." - $scheduler_exe -c $config_file start - sleep 2 - ;; - - 'status') - echo "Checking Campcaster scheduler status..." - $scheduler_exe -c $config_file status - ;; - - 'kill') - echo "Killing all Campcaster scheduler processes..." - killall campcaster-scheduler - sleep 2 - killall -9 campcaster-scheduler - ;; - - *) - echo "Campcaster scheduler System V runlevel init script." - echo "" - echo "Usage:" - echo " $0 start|stop|restart|status|kill" - echo "" - -esac - diff --git a/src/products/scheduler/bin/campcaster-scheduler_devenv.sh b/src/products/scheduler/bin/campcaster-scheduler_devenv.sh deleted file mode 100755 index a9204025c..000000000 --- a/src/products/scheduler/bin/campcaster-scheduler_devenv.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/bin/bash -#-------------------------------------------------------------------------------# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# System V runlevel style invoke script for the Campcaster Scheduler -# This script is only used in the Campcaster development environment -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -libdir=$basedir/lib -tmpdir=$basedir/tmp -vardir=$basedir/var - -usrdir=`cd $basedir/../../../usr; pwd;` - - -#------------------------------------------------------------------------------- -# Set up the environment -#------------------------------------------------------------------------------- -export LD_LIBRARY_PATH=$usrdir/lib:$LD_LIBRARY_PATH - -if [ -x $bindir/campcaster-scheduler ]; then - scheduler_exe=$bindir/campcaster-scheduler -elif [ -x $tmpdir/campcaster-scheduler ]; then - scheduler_exe=$tmpdir/campcaster-scheduler -else - echo "Can't find scheduler executable."; -fi - -if [ -f ~/.campcaster/campcaster-scheduler.xml ]; then - config_file=~/.campcaster/campcaster-scheduler.xml -elif [ -f $etcdir/campcaster-scheduler.xml ]; then - config_file=$etcdir/campcaster-scheduler.xml -else - echo "Can't find configuration file."; -fi - -mode=$1 - - -#------------------------------------------------------------------------------- -# Do what the user asks us to do -#------------------------------------------------------------------------------- -case "$mode" in - 'start') - echo "Starting the Campcaster scheduler..." - $scheduler_exe -c $config_file start - sleep 2 - ;; - - 'run') - echo "Running the Campcaster scheduler..." - $scheduler_exe -c $config_file --debug start - sleep 2 - ;; - - 'stop') - echo "Stopping the Campcaster scheduler..." - $scheduler_exe -c $config_file stop - sleep 2 - ;; - - 'restart') - echo "Stopping the Campcaster scheduler..." - $scheduler_exe -c $config_file stop - sleep 2 - echo "Starting the Campcaster scheduler..." - $scheduler_exe -c $config_file start - sleep 2 - ;; - - 'status') - echo "Checking Campcaster scheduler status..." - $scheduler_exe -c $config_file status - ;; - - 'kill') - echo "Killing all Campcaster scheduler processes..." - killall campcaster-scheduler - sleep 2 - killall -9 campcaster-scheduler - ;; - - *) - echo "Campcaster scheduler System V runlevel init script." - echo "" - echo "Usage:" - echo " $0 start|run|stop|restart|status|kill" - echo "" - -esac - diff --git a/src/products/scheduler/bin/createDatabase.sh b/src/products/scheduler/bin/createDatabase.sh deleted file mode 100755 index 46ebf5a3a..000000000 --- a/src/products/scheduler/bin/createDatabase.sh +++ /dev/null @@ -1,206 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script reates the database used by Campcaster -# -# Invoke as: -# ./bin/createDatabase.sh -# -# To get usage help, try the -h option -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -docdir=$basedir/doc -tmpdir=$basedir/tmp -usrdir=$basedir/usr - - -#------------------------------------------------------------------------------- -# Print the usage information for this script. -#------------------------------------------------------------------------------- -printUsage() -{ - echo "Campcaster scheduler database creation script."; - echo "parameters"; - echo ""; - echo " -D, --database The name of the Campcaster database."; - echo " [default: Campcaster]"; - echo " -s, --dbserver The name of the database server host."; - echo " [default: localhost]"; - echo " -u, --dbuser The name of the database user to access the" - echo " database. [default: campcaster]"; - echo " -w, --dbpassword The database user password."; - echo " [default: campcaster]"; - echo " -h, --help Print this message and exit."; - echo ""; -} - - -#------------------------------------------------------------------------------- -# Process command line parameters -#------------------------------------------------------------------------------- -CMD=${0##*/} - -opts=$(getopt -o D:hs:u:w: -l database:,dbserver:,dbuser:,dbpassword:,help, -n $CMD -- "$@") || exit 1 -eval set -- "$opts" -while true; do - case "$1" in - -D|--database) - database=$2; - shift; shift;; - -h|--help) - printUsage; - exit 0;; - -s|--dbserver) - dbserver=$2; - shift; shift;; - -u|--dbuser) - dbuser=$2; - shift; shift;; - -w|--dbpassword) - dbpassword=$2; - shift; shift;; - --) - shift; - break;; - *) - echo "Unrecognized option $1."; - printUsage; - exit 1; - esac -done - -if [ "x$dbserver" == "x" ]; then - dbserver=localhost; -fi - -if [ "x$database" == "x" ]; then - database=Campcaster; -fi - -if [ "x$dbuser" == "x" ]; then - dbuser=campcaster; -fi - -if [ "x$dbpassword" == "x" ]; then - dbpassword=campcaster; -fi - -echo "Creating database for Campcaster scheduler."; -echo ""; -echo "Using the following parameters:"; -echo ""; -echo " database server: $dbserver"; -echo " database: $database"; -echo " database user: $dbuser"; -echo " database user password: $dbpassword"; -echo "" - -#------------------------------------------------------------------------------- -# The details of installation -#------------------------------------------------------------------------------- - -postgres_user=postgres - -#------------------------------------------------------------------------------- -# Function to check for the existence of an executable on the PATH -# -# @param $1 the name of the exectuable -# @return 0 if the executable exists on the PATH, non-0 otherwise -#------------------------------------------------------------------------------- -check_exe() { - if [ -x "`which $1 2> /dev/null`" ]; then - echo "Executable $1 found..."; - return 0; - else - echo "Executable $1 not found..."; - return 1; - fi -} - - -#------------------------------------------------------------------------------- -# Check to see if this script is being run as root -#------------------------------------------------------------------------------- -if [ `whoami` != "root" ]; then - echo "Please run this script as root."; - exit ; -fi - - -#------------------------------------------------------------------------------- -# Check for required tools -#------------------------------------------------------------------------------- -echo "Checking for required tools..." - -check_exe "su" || exit 1; -check_exe "psql" || exit 1; - - -#------------------------------------------------------------------------------- -# Create the necessary database user and database itself -#------------------------------------------------------------------------------- -echo "Creating database and database user..."; - -# FIXME: the below might not work for remote databases - -if [ "x$dbserver" == "xlocalhost" ]; then - su - $postgres_user -c "echo \"CREATE USER $dbuser \ - ENCRYPTED PASSWORD '$dbpassword' \ - CREATEDB NOCREATEUSER;\" \ - | psql template1" \ - || echo "Couldn't create database user $dbuser."; - - su - $postgres_user -c "echo \"CREATE DATABASE \\\"$database\\\" \ - OWNER $dbuser ENCODING 'utf-8';\" \ - | psql template1" \ - || echo "Couldn't create database $database."; -else - echo "Unable to automatically create database user and table for"; - echo "remote database $dbserver."; - echo "Make sure to create database user $dbuser with password"; - echo "$dbpassword on database server at $dbserver."; - echo "Also create a database called $ld_database, owned by this user."; - echo ""; - echo "The easiest way to achieve this is by issuing the following SQL"; - echo "commands to PostgreSQL:"; - echo "CREATE USER $dbuser"; - echo " ENCRYPTED PASSWORD '$dbpassword'"; - echo " CREATEDB NOCREATEUSER;"; - echo "CREATE DATABASE \"$database\""; - echo " OWNER $dbuser ENCODING 'utf-8';"; -fi - - -# TODO: check for the success of these operations somehow -#------------------------------------------------------------------------------- -# Say goodbye -#------------------------------------------------------------------------------- -echo "Done." - diff --git a/src/products/scheduler/bin/createOdbcDataSource.sh b/src/products/scheduler/bin/createOdbcDataSource.sh deleted file mode 100755 index e70a15e2d..000000000 --- a/src/products/scheduler/bin/createOdbcDataSource.sh +++ /dev/null @@ -1,187 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script creates the ODBC data source needed for Campcaster scheduler -# -# Invoke as: -# ./bin/createOdbcDataSource.sh -# -# To get usage help, try the -h option -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -docdir=$basedir/doc -tmpdir=$basedir/tmp -usrdir=$basedir/usr - - -#------------------------------------------------------------------------------- -# Print the usage information for this script. -#------------------------------------------------------------------------------- -printUsage() -{ - echo "Campcaster scheduler ODBC DataSource creating script."; - echo "parameters"; - echo ""; - echo " -D, --database The name of the Campcaster database."; - echo " [default: Campcaster]"; - echo " -s, --dbserver The name of the database server host."; - echo " [default: localhost]"; - echo " -h, --help Print this message and exit."; - echo ""; -} - - -#------------------------------------------------------------------------------- -# Process command line parameters -#------------------------------------------------------------------------------- -CMD=${0##*/} - -opts=$(getopt -o D:hs: -l database:,dbserver:,help -n $CMD -- "$@") || exit 1 -eval set -- "$opts" -while true; do - case "$1" in - -D|--database) - database=$2; - shift; shift;; - -s|--dbserver) - dbserver=$2; - shift; shift;; - --) - shift; - break;; - *) - echo "Unrecognized option $1."; - printUsage; - exit 1; - esac -done - -if [ "x$dbserver" == "x" ]; then - dbserver=localhost; -fi - -if [ "x$database" == "x" ]; then - database=Campcaster; -fi - - -echo "Creating ODBC data source for Campcaster scheduler."; -echo ""; -echo "Using the following installation parameters:"; -echo ""; -echo " database server: $dbserver"; -echo " database: $database"; -echo "" - -#------------------------------------------------------------------------------- -# The details of installation -#------------------------------------------------------------------------------- -ls_dbserver=$dbserver -ls_database=$database - - -replace_sed_string="s/ls_dbserver/$ls_dbserver/; \ - s/ls_database/$ls_database/;" - - -#------------------------------------------------------------------------------- -# Function to check for the existence of an executable on the PATH -# -# @param $1 the name of the exectuable -# @return 0 if the executable exists on the PATH, non-0 otherwise -#------------------------------------------------------------------------------- -check_exe() { - if [ -x "`which $1 2> /dev/null`" ]; then - echo "Executable $1 found..."; - return 0; - else - echo "Executable $1 not found..."; - return 1; - fi -} - - -#------------------------------------------------------------------------------- -# Check to see if this script is being run as root -#------------------------------------------------------------------------------- -if [ `whoami` != "root" ]; then - echo "Please run this script as root."; - exit ; -fi - - -#------------------------------------------------------------------------------- -# Check for required tools -#------------------------------------------------------------------------------- -echo "Checking for required tools..." - -check_exe "sed" || exit 1; -check_exe "grep" || exit 1; -check_exe "odbcinst" || exit 1; - - -#------------------------------------------------------------------------------- -# Create the ODBC data source and driver -#------------------------------------------------------------------------------- -# check for an existing PostgreSQL ODBC driver, and uninstall if necessary -odbcinst_res=`odbcinst -q -d | grep "\[PostgreSQL_Campcaster\]"` -if [ "x$odbcinst_res" != "x" ]; then - echo "Removing old ODBC PostgreSQL driver..."; - odbcinst -u -d -n PostgreSQL_Campcaster || exit 1; -fi - -echo "Registering ODBC PostgreSQL driver..."; -# check where the odbc dirvers are for PostgreSQL -if [ -f /usr/lib/libodbcpsql.so ]; then - odbcinst_template=$etcdir/odbcinst_template -elif [ -f /usr/lib/odbc/psqlodbc.so ]; then - odbcinst_template=$etcdir/odbcinst_old_debian_template -elif [ -f /usr/lib/odbc/psqlodbcw.so ]; then - odbcinst_template=$etcdir/odbcinst_new_debian_template -else - echo "can't find ODBC driver for PostgreSQL neither at /usr/lib"; - echo "nor at /usr/lib/odbc. please install proper ODBC drivers"; - exit 1; -fi -odbcinst -i -d -f $odbcinst_template || exit 1; - -echo "Registering Campcaster ODBC data source..."; -odbc_template=$etcdir/odbc_template -odbc_template_tmp=/tmp/odbc_template.$$ -cat $odbc_template | sed -e "$replace_sed_string" > $odbc_template_tmp -odbcinst -i -s -l -f $odbc_template_tmp || exit 1; -rm -f $odbc_template_tmp - - -#------------------------------------------------------------------------------- -# Say goodbye -#------------------------------------------------------------------------------- -echo "Done." - diff --git a/src/products/scheduler/bin/gen_coverage_data.sh b/src/products/scheduler/bin/gen_coverage_data.sh deleted file mode 100755 index be3e2d8b3..000000000 --- a/src/products/scheduler/bin/gen_coverage_data.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# This script generates code coverage data for the module -#------------------------------------------------------------------------------- -module="Campcaster Scheduler" - -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -docdir=$basedir/doc -tmpdir=$basedir/tmp - -usrdir=`cd $basedir/../../../usr; pwd;` - -coverage_report_dir=$docdir/coverage - -raw_coverage_file=$tmpdir/raw_coverage.info -coverage_file=$tmpdir/coverage.info - -lcov=$usrdir/bin/lcov -genhtml=$usrdir/bin/genhtml - - -cd $basedir - -#------------------------------------------------------------------------------- -# Re-configure with covarege collection enabled, compile and run the tests -#------------------------------------------------------------------------------- -$bindir/autogen.sh --enable-coverage -make clean -make check - -#------------------------------------------------------------------------------- -# Generate some symlinks so that the sources are visible from tmpdir -#------------------------------------------------------------------------------- -ln -s $basedir/include $tmpdir/include -ln -s $basedir/src $tmpdir/src - - -#------------------------------------------------------------------------------- -# Use lcov to generate an HTML report on the coverage data -#------------------------------------------------------------------------------- -$lcov -d $tmpdir -c > $raw_coverage_file -$lcov -e $raw_coverage_file "$tmpdir/*" > $coverage_file -rm -rf $coverage_report_dir -mkdir -p $coverage_report_dir -$genhtml -t "$module" -o $coverage_report_dir $coverage_file - - -#------------------------------------------------------------------------------- -# Clean up -#------------------------------------------------------------------------------- -rm -f $tmpdir/include -rm -f $tmpdir/src diff --git a/src/products/scheduler/bin/run_tests.sh b/src/products/scheduler/bin/run_tests.sh deleted file mode 100755 index 70d7638ae..000000000 --- a/src/products/scheduler/bin/run_tests.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash -#-------------------------------------------------------------------------------# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run the test suite for the scheduler. -#------------------------------------------------------------------------------- - - -#------------------------------------------------------------------------------- -# Determine directories, files -#------------------------------------------------------------------------------- -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -bindir=$basedir/bin -etcdir=$basedir/etc -libdir=$basedir/lib -tmpdir=$basedir/tmp - -usrdir=`cd $basedir/../../../usr; pwd;` - - -#------------------------------------------------------------------------------- -# Set up the environment -#------------------------------------------------------------------------------- -export LD_LIBRARY_PATH=$usrdir/lib:$LD_LIBRARY_PATH - -if [ -x $tmpdir/testRunner ]; then - testRunner=$tmpdir/testRunner -else - echo "Can't find testRunner executable."; -fi - -if [ -f ~/.campcaster/campcaster-scheduler.xml ]; then - config_file=~/.campcaster/campcaster-scheduler.xml -elif [ -f $etcdir/campcaster-scheduler.xml ]; then - config_file=$etcdir/campcaster-scheduler.xml -else - echo "Can't find configuration file."; -fi - - -#------------------------------------------------------------------------------- -# Run the tests -#------------------------------------------------------------------------------- -$testRunner -c $config_file ${*} - diff --git a/src/products/scheduler/configure b/src/products/scheduler/configure deleted file mode 100755 index 26ccda218..000000000 --- a/src/products/scheduler/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen $*) -fi - -(cd $tmpdir && $configure $*) - diff --git a/src/products/scheduler/doc/doxygen/.keepme b/src/products/scheduler/doc/doxygen/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/products/scheduler/doc/doxygen/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/products/scheduler/doc/model/SchedulerModel.zuml b/src/products/scheduler/doc/model/SchedulerModel.zuml deleted file mode 100644 index 7f105b69f..000000000 Binary files a/src/products/scheduler/doc/model/SchedulerModel.zuml and /dev/null differ diff --git a/src/products/scheduler/etc/Makefile.in b/src/products/scheduler/etc/Makefile.in deleted file mode 100644 index c7ab352c6..000000000 --- a/src/products/scheduler/etc/Makefile.in +++ /dev/null @@ -1,462 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# @configure_input@ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -KILLALL = killall -CP = cp -f -SED = sed -ECHO = echo -CAT = cat - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -BASE_DIR = @builddir@ -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -BIN_DIR = ${BASE_DIR}/bin -ETC_DIR = ${BASE_DIR}/etc -SRC_DIR = ${BASE_DIR}/src -VAR_DIR = ${BASE_DIR}/var -TMP_DIR = ${BASE_DIR}/tmp - -REAL_BASE_DIR=$(shell cd ${BASE_DIR}; pwd) - - -prefix = @prefix@ - -USR_DIR = ${prefix} -USR_BIN_DIR = ${USR_DIR}/bin -USR_ETC_DIR = ${USR_DIR}/etc -USR_INCLUDE_DIR = ${USR_DIR}/include -USR_LIB_DIR = ${USR_DIR}/lib -USR_VAR_DIR = ${USR_DIR}/var/Campcaster/scheduler/var -USR_TMP_DIR = ${USR_DIR}/tmp -STORAGE_TMP_DIR = "/tmp" - -HOSTNAME = @HOSTNAME@ -WWW_PORT = @WWW_PORT@ -SCHEDULER_PORT = @SCHEDULER_PORT@ -DB_SERVER = @DB_SERVER@ -DATABASE = @DATABASE@ -DB_USER = @DB_USER@ -DB_PASSWORD = @DB_PASSWORD@ -AUDIO_OUT = "@AUDIO_OUT@" - -PHP_URL_PREFIX=campcaster -ALIB_XML_RPC_PREFIX=xmlrpc/xrLocStor.php -POSTGRES_USER=postgres - -USR_LIB_DIR_S=$(shell ${ECHO} ${USR_LIB_DIR} | ${SED} -e "s/\//\\\\\\\\\//g") -STORAGE_TMP_DIR_S=$(shell ${ECHO} ${STORAGE_TMP_DIR} | \ - ${SED} -e "s/\//\\\\\\\\\//g") -PHP_URL_PREFIX_S=$(shell ${ECHO} ${PHP_URL_PREFIX} | \ - ${SED} -e "s/\//\\\\\\\\\//g") -ALIB_XML_RPC_PREFIX_S=$(shell ${ECHO} ${ALIB_XML_RPC_PREFIX} | \ - ${SED} -e "s/\//\\\\\\\\\//g") -AUDIO_OUT_S=$(shell ${ECHO} ${AUDIO_OUT} | ${SED} -e "s/\//\\\\\\\\\//g") - - -REPLACE_SED_STRING="s/ls_lib_dir/${USR_LIB_DIR_S}/; \ - s/ls_dbuser/${DB_USER}/; \ - s/ls_dbpassword/${DB_PASSWORD}/; \ - s/ls_dbserver/${DB_SERVER}/; \ - s/ls_database/${DATABASE}/; \ - s/ls_php_urlPrefix/${PHP_URL_PREFIX_S}/; \ - s/ls_php_host/${HOSTNAME}/; \ - s/ls_php_port/${WWW_PORT}/; \ - s/ls_alib_xmlRpcPrefix/${ALIB_XML_RPC_PREFIX_S}/; \ - s/ls_tmp_dir/${STORAGE_TMP_DIR_S}/; \ - s/ls_audio_output_device/${AUDIO_OUT_S}/; \ - s/ls_scheduler_host/${HOSTNAME}/; \ - s/ls_scheduler_port/${SCHEDULER_PORT}/;" - -VPATH = ${SRC_DIR} - -BOOST_CFLAGS=@BOOST_CPPFLAGS@ -BOOST_LIBS=@BOOST_LDFLAGS@ -BOOST_DATE_TIME_LIB=@BOOST_DATE_TIME_LIB@ - -LIBXMLPP_CFLAGS=@LIBXMLPP_CFLAGS@ -LIBXMLPP_LIBS=@LIBXMLPP_LIBS@ - -LIBODBCXX_CFLAGS=@LIBODBCXX_CFLAGS@ -LIBODBCXX_LIBS=@LIBODBCXX_LIBS@ - -GSTREAMER_CFLAGS=@GSTREAMER_CFLAGS@ -GSTREAMER_LIBS=@GSTREAMER_LIBS@ - -GSTCONTROLLER_CFLAGS=@GSTCONTROLLER_CFLAGS@ -GSTCONTROLLER_LIBS=@GSTCONTROLLER_LIBS@ - -CURL_CFLAGS=@CURL_CFLAGS@ -CURL_LIBS=@CURL_LIBS@ - -ICU_CFLAGS=@ICU_CFLAGS@ -ICU_CXXFLAGS=@ICU_CXXFLAGS@ -ICU_LIBS=@ICU_LIBS@ - -TAGLIB_CFLAGS=@TAGLIB_CFLAGS@ -TAGLIB_LIBS=@TAGLIB_LIBS@ - -MODULES_DIR = ${BASE_DIR}/../../modules - -CORE_DIR = ${MODULES_DIR}/core -CORE_INCLUDE_DIR = ${CORE_DIR}/include -CORE_LIB_DIR = ${CORE_DIR}/lib -CORE_LIB = livesupport_core -CORE_LIB_FILE = ${CORE_LIB_DIR}/lib${CORE_LIB}.a - -AUTHENTICATION_DIR = ${MODULES_DIR}/authentication -AUTHENTICATION_INCLUDE_DIR = ${AUTHENTICATION_DIR}/include -AUTHENTICATION_LIB_DIR = ${AUTHENTICATION_DIR}/lib -AUTHENTICATION_LIB = livesupport_authentication -AUTHENTICATION_LIB_FILE = ${AUTHENTICATION_LIB_DIR}/lib${AUTHENTICATION_LIB}.a - -DB_DIR = ${MODULES_DIR}/db -DB_INCLUDE_DIR = ${DB_DIR}/include -DB_LIB_DIR = ${DB_DIR}/lib -DB_LIB = livesupport_db -DB_LIB_FILE = ${DB_LIB_DIR}/lib${DB_LIB}.a - -STORAGE_CLIENT_DIR = ${MODULES_DIR}/storageClient -STORAGE_CLIENT_INCLUDE_DIR = ${STORAGE_CLIENT_DIR}/include -STORAGE_CLIENT_LIB_DIR = ${STORAGE_CLIENT_DIR}/lib -STORAGE_CLIENT_LIB = livesupport_storage_client -STORAGE_CLIENT_LIB_FILE = ${STORAGE_CLIENT_LIB_DIR}/lib${STORAGE_CLIENT_LIB}.a - -STORAGE_SERVER_DIR = ${MODULES_DIR}/storageServer - -PLAYLIST_EXECUTOR_DIR = ${MODULES_DIR}/playlistExecutor -PLAYLIST_EXECUTOR_INCLUDE_DIR = ${PLAYLIST_EXECUTOR_DIR}/include -PLAYLIST_EXECUTOR_LIB_DIR = ${PLAYLIST_EXECUTOR_DIR}/lib -PLAYLIST_EXECUTOR_LIB = livesupport_playlist_executor -PLAYLIST_EXECUTOR_LIB_FILE = ${PLAYLIST_EXECUTOR_LIB_DIR}/lib${PLAYLIST_EXECUTOR_LIB}.a - -EVENT_SCHEDULER_DIR = ${MODULES_DIR}/eventScheduler -EVENT_SCHEDULER_INCLUDE_DIR = ${EVENT_SCHEDULER_DIR}/include -EVENT_SCHEDULER_LIB_DIR = ${EVENT_SCHEDULER_DIR}/lib -EVENT_SCHEDULER_LIB = livesupport_event_scheduler -EVENT_SCHEDULER_LIB_FILE = ${EVENT_SCHEDULER_LIB_DIR}/lib${EVENT_SCHEDULER_LIB}.a - -TEST_RESULTS = ${DOC_DIR}/testResults.xml -# the text result XSLT has to be relative to the test result file, e.g. TMP_DIR -TEST_XSLT = ../etc/testResultToHtml.xsl - -SCHEDULER_EXE = ${TMP_DIR}/campcaster-scheduler -SCHEDULER_SH = ${BIN_DIR}/campcaster-scheduler_devenv.sh -SCHEDULER_CFG = ${ETC_DIR}/campcaster-scheduler.xml -SCHEDULER_LOCAL_CFG = ${ETC_DIR}/campcaster-scheduler-local.xml -TEST_RUNNER = ${TMP_DIR}/testRunner -TEST_RUNNER_SH = ${BIN_DIR}/run_tests.sh - -DOXYGEN_CONFIG = ${ETC_DIR}/doxygen.config - -export LD_LIBRARY_PATH:=${USR_LIB_DIR}:${LD_LIBRARY_PATH} - - -#------------------------------------------------------------------------------- -# Configuration parameters -#------------------------------------------------------------------------------- -CPPFLAGS = @CPPFLAGS@ -CXXFLAGS = @CXXFLAGS@ @DEFS@ @COVERAGE_CXXFLAGS@ -pthread \ - -pedantic -Wall -Wno-long-long \ - ${BOOST_CFLAGS} \ - ${LIBXMLPP_CFLAGS} \ - ${LIBODBCXX_CFLAGS} \ - ${GSTREAMER_CFLAGS} \ - ${GSTCONTROLLER_CFLAGS} \ - ${TAGLIB_CFLAGS} \ - ${LIBTAR_CFLAGS} \ - -I${USR_INCLUDE_DIR} \ - -I${CORE_INCLUDE_DIR} \ - -I${AUTHENTICATION_INCLUDE_DIR} \ - -I${DB_INCLUDE_DIR} \ - -I${STORAGE_CLIENT_INCLUDE_DIR} \ - -I${PLAYLIST_EXECUTOR_INCLUDE_DIR} \ - -I${EVENT_SCHEDULER_INCLUDE_DIR} \ - -I${TMP_DIR} -LDFLAGS = @LDFLAGS@ -pthread \ - ${BOOST_LIBS} \ - ${LIBXMLPP_LIBS} \ - ${LIBODBCXX_LIBS} \ - ${GSTREAMER_LIBS} \ - ${GSTCONTROLLER_LIBS} \ - ${CURL_LIBS} \ - ${ICU_LIBS} \ - ${TAGLIB_LIBS} \ - ${LIBTAR_LIBS} \ - -L${USR_LIB_DIR} \ - -L${CORE_LIB_DIR} \ - -L${AUTHENTICATION_LIB_DIR} \ - -L${DB_LIB_DIR} \ - -L${STORAGE_CLIENT_LIB_DIR} \ - -L${PLAYLIST_EXECUTOR_LIB_DIR} \ - -L${EVENT_SCHEDULER_LIB_DIR} - - -#------------------------------------------------------------------------------- -# Dependencies -#------------------------------------------------------------------------------- -SCHEDULER_OBJS = ${TMP_DIR}/SignalDispatcher.o \ - ${TMP_DIR}/XmlRpcDaemon.o \ - ${TMP_DIR}/SchedulerDaemon.o \ - ${TMP_DIR}/GetVersionMethod.o \ - ${TMP_DIR}/UploadPlaylistMethod.o \ - ${TMP_DIR}/DisplayScheduleMethod.o \ - ${TMP_DIR}/RemoveFromScheduleMethod.o \ - ${TMP_DIR}/RescheduleMethod.o \ - ${TMP_DIR}/ScheduleFactory.o \ - ${TMP_DIR}/PostgresqlSchedule.o \ - ${TMP_DIR}/GetSchedulerTimeMethod.o \ - ${TMP_DIR}/PlayLogFactory.o \ - ${TMP_DIR}/PostgresqlPlayLog.o \ - ${TMP_DIR}/GeneratePlayReportMethod.o \ - ${TMP_DIR}/PlaylistEventContainer.o \ - ${TMP_DIR}/PlaylistEvent.o \ - ${TMP_DIR}/ResetStorageMethod.o \ - ${TMP_DIR}/LoginMethod.o \ - ${TMP_DIR}/LogoutMethod.o \ - ${TMP_DIR}/BackupFactory.o \ - ${TMP_DIR}/PostgresqlBackup.o \ - ${TMP_DIR}/CreateBackupOpenMethod.o \ - ${TMP_DIR}/CreateBackupCheckMethod.o \ - ${TMP_DIR}/CreateBackupCloseMethod.o \ - ${TMP_DIR}/RestoreBackupMethod.o \ - ${TMP_DIR}/StopCurrentlyPlayingMethod.o - - -SCHEDULER_EXE_OBJS = ${SCHEDULER_OBJS} \ - ${TMP_DIR}/main.o -SCHEDULER_EXE_LIBS = -l${EVENT_SCHEDULER_LIB} -l${PLAYLIST_EXECUTOR_LIB} \ - -l${STORAGE_CLIENT_LIB} -l${DB_LIB} \ - -l${AUTHENTICATION_LIB} \ - -l${CORE_LIB} \ - ${BOOST_DATE_TIME_LIB} \ - -lxmlrpc++ -lssl -ltar - -TEST_RUNNER_OBJS = ${SCHEDULER_OBJS} \ - ${TMP_DIR}/TestRunner.o \ - ${TMP_DIR}/BaseTestMethod.o \ - ${TMP_DIR}/ResetStorageMethodTest.o \ - ${TMP_DIR}/SchedulerDaemonTest.o \ - ${TMP_DIR}/GetSchedulerTimeMethodTest.o \ - ${TMP_DIR}/RpcGetSchedulerTimeTest.o \ - ${TMP_DIR}/GetVersionMethodTest.o \ - ${TMP_DIR}/RpcGetVersionTest.o \ - ${TMP_DIR}/UploadPlaylistMethodTest.o \ - ${TMP_DIR}/RpcUploadPlaylistTest.o \ - ${TMP_DIR}/DisplayScheduleMethodTest.o \ - ${TMP_DIR}/RpcDisplayScheduleTest.o \ - ${TMP_DIR}/RemoveFromScheduleMethodTest.o \ - ${TMP_DIR}/RpcRemoveFromScheduleTest.o \ - ${TMP_DIR}/RescheduleMethodTest.o \ - ${TMP_DIR}/RpcRescheduleTest.o \ - ${TMP_DIR}/PostgresqlScheduleTest.o \ - ${TMP_DIR}/PostgresqlPlayLogTest.o \ - ${TMP_DIR}/GeneratePlayReportMethodTest.o \ - ${TMP_DIR}/RpcGeneratePlayReportTest.o \ - ${TMP_DIR}/PlaylistEventContainerTest.o \ - ${TMP_DIR}/PlaylistEventTest.o \ - ${TMP_DIR}/PostgresqlBackupTest.o \ - ${TMP_DIR}/RpcBackupTest.o \ - ${TMP_DIR}/RpcStopCurrentlyPlayingTest.o - -TEST_RUNNER_LIBS = ${SCHEDULER_EXE_LIBS} -lcppunit -ldl - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -.PHONY: all dir_setup doc clean docclean depclean distclean check install -.PHONY: init start status run_tests stop deinit -.PHONY: init_local start_local status_local run_local stop_local -.PHONY: deinit_local check check_local -.PHONY: copy_files create_database create_odbc_datasource init_database - -all: dir_setup ${SCHEDULER_EXE} - -dir_setup: ${TMP_DIR} ${DOXYGEN_DIR} - -doc: - ${DOXYGEN} ${DOXYGEN_CONFIG} - -clean: - ${RM} ${SCHEDULER_EXE_OBJS} ${SCHEDULER_EXE} - ${RM} ${TEST_RUNNER_OBJS} ${TEST_RUNNER} - ${RM} ${TMP_DIR}/*.bb ${TMP_DIR}/*.bbg ${TMP_DIR}/*.da ${TMP_DIR}/*.info - -docclean: - ${RMDIR} ${DOXYGEN_DIR}/html - ${RMDIR} ${COVERAGE_DIR}/* - ${RM} ${TEST_RESULTS} - -depclean: clean - ${MAKE} -C ${EVENT_SCHEDULER_DIR} clean - ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} clean - ${MAKE} -C ${STORAGE_CLIENT_DIR} clean - ${MAKE} -C ${DB_DIR} clean - ${MAKE} -C ${AUTHENTICATION_DIR} clean - ${MAKE} -C ${CORE_DIR} clean - -distclean: clean docclean - ${RMDIR} ${TMP_DIR}/config* ${TMP_DIR}/autom4te* ${TMP_DIR}/ac*.m4 - -check: all ${TEST_RUNNER} storage_server_init kill start run_tests stop - -install: all copy_files create_database create_odbc_datasource init_database - -copy_files: - ${MAKE} -C ${CORE_DIR} install - ${MAKE} -C ${AUTHENTICATION_DIR} install - ${MAKE} -C ${DB_DIR} install - ${MAKE} -C ${STORAGE_CLIENT_DIR} install - ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} install - ${MAKE} -C ${EVENT_SCHEDULER_DIR} install - ${MKDIR} ${USR_BIN_DIR} - ${MKDIR} ${USR_ETC_DIR} - ${MKDIR} ${USR_TMP_DIR} - ${CP} ${BIN_DIR}/campcaster-scheduler.sh ${USR_BIN_DIR} - ${CP} ${SCHEDULER_EXE} ${USR_BIN_DIR} - ${CP} ${ETC_DIR}/odbcinst_old_debian_template \ - ${ETC_DIR}/odbcinst_new_debian_template \ - ${ETC_DIR}/odbcinst_template ${USR_ETC_DIR} - ${CP} ${BIN_DIR}/createDatabase.sh \ - ${BIN_DIR}/createOdbcDataSource.sh ${USR_BIN_DIR} - ${CAT} ${ETC_DIR}/odbc_template | ${SED} -e ${REPLACE_SED_STRING} \ - > ${USR_ETC_DIR}/odbc_template - ${CAT} ${ETC_DIR}/campcaster-scheduler.xml.template \ - | ${SED} -e ${REPLACE_SED_STRING} \ - > ${USR_ETC_DIR}/campcaster-scheduler.xml - -create_database: -ifeq (@CREATE_LS_DATABASE@,yes) - ${BIN_DIR}/createDatabase.sh --database=${DATABASE} \ - --dbserver=${DB_SERVER} \ - --dbuser=${DB_USER} \ - --dbpassword=${DB_PASSWORD} -endif - -create_odbc_datasource: -ifeq (@CREATE_ODBC_DATA_SOURCE@,yes) - ${BIN_DIR}/createOdbcDataSource.sh --database=${DATABASE} \ - --dbserver=${DB_SERVER} -endif - -check_local: all ${TEST_RUNNER} kill start_local run_tests stop_local - -run_tests: ${TEST_RUNNER} - ${TEST_RUNNER_SH} -o ${TEST_RESULTS} -s ${TEST_XSLT} - -start: ${SCHEDULER_EXE} - ${SCHEDULER_SH} start - sleep 2 - -run: ${SCHEDULER_EXE} - ${SCHEDULER_SH} run - -stop: ${SCHEDULER_EXE} - ${SCHEDULER_SH} stop - sleep 2 - -status: ${SCHEDULER_EXE} - ${SCHEDULER_SH} status - -start_local: ${SCHEDULER_EXE} - ${SCHEDULER_EXE} -c ${SCHEDULER_LOCAL_CFG} start - sleep 2 - -stop_local: ${SCHEDULER_EXE} - ${SCHEDULER_EXE} -c ${SCHEDULER_LOCAL_CFG} stop - sleep 2 - -status_local: ${SCHEDULER_EXE} - ${SCHEDULER_EXE} -c ${SCHEDULER_LOCAL_CFG} status - -run_local: ${SCHEDULER_EXE} - ${SCHEDULER_EXE} -c ${SCHEDULER_LOCAL_CFG} --debug start - sleep 2 - -storage_server_init: - ${MAKE} -C ${STORAGE_SERVER_DIR} - -kill: - ${KILLALL} campcaster-scheduler || true - sleep 2 - ${KILLALL} -9 campcaster-scheduler || true - - -#------------------------------------------------------------------------------- -# Specific targets -#------------------------------------------------------------------------------- -${SCHEDULER_EXE}: ${CORE_LIB_FILE} ${AUTHENTICATION_LIB_FILE} ${DB_LIB_FILE} \ - ${STORAGE_CLIENT_LIB_FILE} \ - ${PLAYLIST_EXECUTOR_LIB_FILE} ${EVENT_SCHEDULER_LIB_FILE} \ - ${SCHEDULER_EXE_OBJS} - ${CXX} ${LDFLAGS} -o $@ $^ ${SCHEDULER_EXE_LIBS} - -${TMP_DIR}: - ${MKDIR} ${TMP_DIR} - -${DOXYGEN_DIR}: - ${MKDIR} ${DOXYGEN_DIR} - -${TEST_RUNNER}: ${CORE_LIB_FILE} ${AUTHENTICATION_LIB_FILE} ${DB_LIB_FILE} \ - ${STORAGE_CLIENT_LIB_FILE} \ - ${PLAYLIST_EXECUTOR_LIB_FILE} ${EVENT_SCHEDULER_LIB_FILE} \ - ${TEST_RUNNER_OBJS} - ${CXX} ${LDFLAGS} -o $@ ${TEST_RUNNER_OBJS} ${TEST_RUNNER_LIBS} - -${CORE_LIB_FILE}: - ${MAKE} -C ${CORE_DIR} - -${AUTHENTICATION_LIB_FILE} : - ${MAKE} -C ${AUTHENTICATION_DIR} - -${DB_LIB_FILE}: - ${MAKE} -C ${DB_DIR} - -${STORAGE_CLIENT_LIB_FILE}: - ${MAKE} -C ${STORAGE_CLIENT_DIR} - -${PLAYLIST_EXECUTOR_LIB_FILE}: - ${MAKE} -C ${PLAYLIST_EXECUTOR_DIR} - -${EVENT_SCHEDULER_LIB_FILE}: - ${MAKE} -C ${EVENT_SCHEDULER_DIR} - - -#------------------------------------------------------------------------------- -# Pattern rules -#------------------------------------------------------------------------------- -${TMP_DIR}/%.o : ${SRC_DIR}/%.cxx - ${CXX} ${CPPFLAGS} ${CXXFLAGS} -c -o $@ $< - diff --git a/src/products/scheduler/etc/acinclude.m4 b/src/products/scheduler/etc/acinclude.m4 deleted file mode 100644 index 20cd235ab..000000000 --- a/src/products/scheduler/etc/acinclude.m4 +++ /dev/null @@ -1,575 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl Macro to check for available modules using pkg-conf -dnl -dnl usage: -dnl PKG_CHECK_MODULES(GSTUFF,[gtk+-2.0 >= 1.3], action-if, action-not) -dnl -dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page -dnl also defines GSTUFF_PKG_ERRORS on error -dnl -dnl This function was taken from the glade-- project -dnl----------------------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], [ - succeeded=no - - if test -z "$PKG_CONFIG"; then - AC_PATH_PROG(PKG_CONFIG, pkg-config, no) - fi - - if test "$PKG_CONFIG" = "no" ; then - echo "*** The pkg-config script could not be found. Make sure it is" - echo "*** in your path, or set the PKG_CONFIG environment variable" - echo "*** to the full path to pkg-config." - echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config." - else - PKG_CONFIG_MIN_VERSION=0.9.0 - if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then - AC_MSG_CHECKING(for $2) - - if $PKG_CONFIG --exists "$2" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING($1_CFLAGS) - $1_CFLAGS=`$PKG_CONFIG --cflags "$2"` - AC_MSG_RESULT($$1_CFLAGS) - - AC_MSG_CHECKING($1_LIBS) - $1_LIBS=`$PKG_CONFIG --libs "$2"` - AC_MSG_RESULT($$1_LIBS) - else - $1_CFLAGS="" - $1_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - ifelse([$4], ,echo $$1_PKG_ERRORS,) - fi - - AC_SUBST($1_CFLAGS) - AC_SUBST($1_LIBS) - else - echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer." - echo "*** See http://www.freedesktop.org/software/pkgconfig" - fi - fi - - if test $succeeded = yes; then - ifelse([$3], , :, [$3]) - else - ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for taglib of sufficient version by looking at taglib-config -dnl -dnl usage: -dnl AC_CHECK_TAGLIB(version, action-if, action-not) -dnl -dnl defines TAGLIB_LIBS, TAGLIB_CFLAGS, see taglib-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_TAGLIB], [ - succeeded=no - - if test -z "$TAGLIB_CONFIG"; then - AC_PATH_PROG(TAGLIB_CONFIG, taglib-config, no) - fi - - if test "$TAGLIB_CONFIG" = "no" ; then - echo "*** The taglib-config script could not be found. Make sure it is" - echo "*** in your path, and that taglib is properly installed." - echo "*** Or see http://developer.kde.org/~wheeler/taglib.html" - else - TAGLIB_VERSION=`$TAGLIB_CONFIG --version` - AC_MSG_CHECKING(for taglib >= $1) - VERSION_CHECK=`expr $TAGLIB_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(TAGLIB_CFLAGS) - TAGLIB_CFLAGS=`$TAGLIB_CONFIG --cflags` - AC_MSG_RESULT($TAGLIB_CFLAGS) - - AC_MSG_CHECKING(TAGLIB_LIBS) - TAGLIB_LIBS=`$TAGLIB_CONFIG --libs` - AC_MSG_RESULT($TAGLIB_LIBS) - else - TAGLIB_CFLAGS="" - TAGLIB_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find taglib >= $1",) - fi - - AC_SUBST(TAGLIB_CFLAGS) - AC_SUBST(TAGLIB_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (taglib) not met.]), [$3]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for ICU of sufficient version by looking at icu-config -dnl -dnl usage: -dnl AC_CHECK_ICU(version, action-if, action-not) -dnl -dnl defines ICU_LIBS, ICU_CFLAGS, ICU_CXXFLAGS, see icu-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_ICU], [ - succeeded=no - - if test -z "$ICU_CONFIG"; then - AC_PATH_PROG(ICU_CONFIG, icu-config, no) - fi - - if test "$ICU_CONFIG" = "no" ; then - echo "*** The icu-config script could not be found. Make sure it is" - echo "*** in your path, and that taglib is properly installed." - echo "*** Or see http://ibm.com/software/globalization/icu/" - else - ICU_VERSION=`$ICU_CONFIG --version` - AC_MSG_CHECKING(for ICU >= $1) - VERSION_CHECK=`expr $ICU_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(ICU_CFLAGS) - ICU_CFLAGS=`$ICU_CONFIG --cflags` - AC_MSG_RESULT($ICU_CFLAGS) - - AC_MSG_CHECKING(ICU_CXXFLAGS) - ICU_CXXFLAGS=`$ICU_CONFIG --cxxflags` - AC_MSG_RESULT($ICU_CXXFLAGS) - - AC_MSG_CHECKING(ICU_LIBS) - ICU_LIBS=`$ICU_CONFIG --ldflags` - AC_MSG_RESULT($ICU_LIBS) - else - ICU_CFLAGS="" - ICU_CXXFLAGS="" - ICU_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find ICU >= $1",) - fi - - AC_SUBST(ICU_CFLAGS) - AC_SUBST(ICU_CXXFLAGS) - AC_SUBST(ICU_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (ICU) not met.]), [$3]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for curl of sufficient version by looking at curl-config -dnl -dnl usage: -dnl AC_CHECK_CURL(version, action-if, action-not) -dnl -dnl defines CURL_LIBS, CURL_CFLAGS, see curl-config man page -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CHECK_CURL], [ - succeeded=no - - if test -z "$CURL_CONFIG"; then - AC_PATH_PROG(CURL_CONFIG, curl-config, no) - fi - - if test "$CURL_CONFIG" = "no" ; then - echo "*** The curl-config script could not be found. Make sure it is" - echo "*** in your path, and that curl is properly installed." - echo "*** Or see http://curl.haxx.se/" - else - dnl curl-config --version returns "libcurl ", thus cut the number - CURL_VERSION=`$CURL_CONFIG --version | cut -d" " -f2` - AC_MSG_CHECKING(for curl >= $1) - VERSION_CHECK=`expr $CURL_VERSION \>\= $1` - if test "$VERSION_CHECK" = "1" ; then - AC_MSG_RESULT(yes) - succeeded=yes - - AC_MSG_CHECKING(CURL_CFLAGS) - CURL_CFLAGS=`$CURL_CONFIG --cflags` - AC_MSG_RESULT($CURL_CFLAGS) - - AC_MSG_CHECKING(CURL_LIBS) - CURL_LIBS=`$CURL_CONFIG --libs` - AC_MSG_RESULT($CURL_LIBS) - else - CURL_CFLAGS="" - CURL_LIBS="" - ## If we have a custom action on failure, don't print errors, but - ## do set a variable so people can do so. - ifelse([$3], ,echo "can't find curl >= $1",) - fi - - AC_SUBST(CURL_CFLAGS) - AC_SUBST(CURL_LIBS) - fi - - if test $succeeded = yes; then - ifelse([$2], , :, [$2]) - else - ifelse([$3], , AC_MSG_ERROR([Library requirements (curl) not met.]), [$3]) - fi -]) - - - -dnl----------------------------------------------------------------------------- -dnl Macro to check for C++ namespaces -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ac_cxx_namespaces.html -dnl -dnl usage: -dnl If the compiler can prevent names clashes using namespaces, -dnl define HAVE_NAMESPACES. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AC_CXX_NAMESPACES], -[AC_CACHE_CHECK(whether the compiler implements namespaces, -ac_cv_cxx_namespaces, -[AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE -]) -if test "$ac_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) -fi -]) - - -dnl----------------------------------------------------------------------------- -dnl Test for the Boost C++ libraries of a particular version (or newer). -dnl for more information on boost, see http://www.boost.org/ -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ax_boost_base.html -dnl -dnl usage: -dnl If no path to the installed boost library is given the macro searches -dnl under ${prefix}, /usr, /usr/local, and /opt, and evaluates the $BOOST_ROOT -dnl environment variable. Further documentation is available at -dnl http://randspringer.de/boost/index.html -dnl -dnl This macro calls: AC_SUBST(BOOST_CPPFLAGS) and AC_SUBST(BOOST_LDFLAGS) -dnl and sets: HAVE_BOOST -dnl -dnl Modified for Campcaster: -dnl * --with-boost default changed to Yes; -dnl * if the library is not found, it does not die, just prints "no", leaves -dnl HAVE_BOOST undefined, and sets the BOOST_CPPFLAGS and BOOST_LDFLAGS -dnl variables to ""; -dnl * ${prefix} is prepended to the search path. -dnl -dnl Author: Thomas Porschberg -dnl -dnl License: -dnl Copyright © 2006 Thomas Porschberg -dnl Copying and distribution of this file, with or without modification, -dnl are permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is Yes) - it is possible to specify the root directory for boost (optional)]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ac_boost_path="" - else - want_boost="yes" - ac_boost_path="$withval" - fi - ], - [want_boost="yes"]) - -if test "x$want_boost" = "xyes"; then - boost_lib_version_req=ifelse([$1], ,1.20.0,$1) - boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'` - boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'` - boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'` - boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - if test "x$boost_lib_version_req_sub_minor" = "x" ; then - boost_lib_version_req_sub_minor="0" - fi - WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor` - AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req) - succeeded=no - - dnl first we check the system location for boost libraries - dnl this location ist chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - BOOST_CPPFLAGS="-I$ac_boost_path/include" - else - for ac_boost_path_tmp in ${prefix} /usr /usr/local /opt ; do - if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then - BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib" - BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include" - break; - fi - done - fi - - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes"; then - _version=0 - if test "$ac_boost_path" != ""; then - BOOST_LDFLAGS="-L$ac_boost_path/lib" - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE" - done - fi - else - for ac_boost_path in /usr /usr/local /opt ; do - if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then - for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "$V_CHECK" = "1" ; then - _version=$_version_tmp - best_path=$ac_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - BOOST_LDFLAGS="-L$best_path/lib" - - if test "x$BOOST_ROOT" != "x"; then - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "$V_CHECK" = "1" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if BOOST_VERSION >= $WANT_BOOST_VERSION - // Everything is okay - #else - # error Boost version is too old - #endif - ]])],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "$succeeded" != "yes" ; then - BOOST_CPPFLAGS="" - BOOST_LDFLAGS="" - AC_MSG_RESULT(no) - else - AC_SUBST(BOOST_CPPFLAGS) - AC_SUBST(BOOST_LDFLAGS) - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" -fi - -]) - - -dnl----------------------------------------------------------------------------- -dnl Test for Date_Time library from the Boost C++ libraries. -dnl for more information on boost, see http://www.boost.org/ -dnl for more information on this macro, see -dnl http://autoconf-archive.cryp.to/ax_boost_date_time.html -dnl -dnl usage: -dnl The macro requires a preceding call to AX_BOOST_BASE. -dnl Further documentation is available at -dnl . -dnl -dnl This macro calls: AC_SUBST(BOOST_DATE_TIME_LIB) -dnl and sets: HAVE_BOOST_DATE_TIME -dnl -dnl Modified for Campcaster: -dnl * --with-boost-date-time default changed to Yes. -dnl * added some more recognized suffixes to the library's name, incl. "-st". -dnl -dnl Authors: -dnl Thomas Porschberg -dnl Michael Tindal -dnl -dnl License: -dnl Copyright © 2006 Thomas Porschberg -dnl Copying and distribution of this file, with or without modification, -dnl are permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. -dnl----------------------------------------------------------------------------- -AC_DEFUN([AX_BOOST_DATE_TIME], -[ - AC_ARG_WITH([boost-date-time], - AS_HELP_STRING([--with-boost-date-time@<:@=special-lib@:>@], - [use the Date_Time library from boost - it is possible to specify a certain library for the linker - e.g. --with-boost-date-time=boost_date_time-gcc-mt-d-1_33_1 ]), - [ - if test "$withval" = "no"; then - want_boost="no" - elif test "$withval" = "yes"; then - want_boost="yes" - ax_boost_user_date_time_lib="" - else - want_boost="yes" - ax_boost_user_date_time_lib="$withval" - fi - ], - [want_boost="yes"] - ) - - if test "x$want_boost" = "xyes"; then - AC_REQUIRE([AC_PROG_CC]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - LDFLAGS_SAVED="$LDFLAGS" - LDFLAGS="$LDFLAGS $BOOST_LDFLAGS" - export LDFLAGS - - AC_CACHE_CHECK(whether the Boost::Date_Time library is available, - ax_cv_boost_date_time, - [AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include ]], - [[using namespace boost::gregorian; date d(2002,Jan,10); - return 0; - ]]), - ax_cv_boost_date_time=yes, ax_cv_boost_date_time=no) - AC_LANG_POP([C++]) - ]) - if test "x$ax_cv_boost_date_time" = "xyes"; then - AC_DEFINE(HAVE_BOOST_DATE_TIME,,[define if the Boost::Date_Time library is available]) - BN=boost_date_time - if test "x$ax_boost_user_date_time_lib" = "x"; then - for ax_lib in $BN $BN-st $BN-mt $BN-mt-s $BN-s \ - $BN-$CC $BN-$CC-st $BN-$CC-mt $BN-$CC-mt-s $BN-$CC-s \ - lib$BN lib$BN-st lib$BN-mt lib$BN-mt-s lib$BN-s \ - lib$BN-$CC lib$BN-$CC-st lib$BN-$CC-mt lib$BN-$CC-mt-s lib$BN-$CC-s \ - $BN-mgw $BN-mgw $BN-mgw-st $BN-mgw-mt $BN-mgw-mt-s $BN-mgw-s ; do - AC_CHECK_LIB($ax_lib, main, [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], - [link_date_time="no"]) - done - else - for ax_lib in $ax_boost_user_date_time_lib $BN-$ax_boost_user_date_time_lib; do - AC_CHECK_LIB($ax_lib, main, - [BOOST_DATE_TIME_LIB="-l$ax_lib" AC_SUBST(BOOST_DATE_TIME_LIB) link_date_time="yes" break], - [link_date_time="no"]) - done - - fi - if test "x$link_date_time" = "xno"; then - AC_MSG_ERROR(Could not link against $ax_lib !) - fi - fi - - CPPFLAGS="$CPPFLAGS_SAVED" - LDFLAGS="$LDFLAGS_SAVED" - fi -]) - diff --git a/src/products/scheduler/etc/authenticationClient.xml b/src/products/scheduler/etc/authenticationClient.xml deleted file mode 100644 index 7a1580f07..000000000 --- a/src/products/scheduler/etc/authenticationClient.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -]> - - - - - diff --git a/src/products/scheduler/etc/campcaster-scheduler-local.xml b/src/products/scheduler/etc/campcaster-scheduler-local.xml deleted file mode 100644 index b641f828b..000000000 --- a/src/products/scheduler/etc/campcaster-scheduler-local.xml +++ /dev/null @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/products/scheduler/etc/campcaster-scheduler.xml b/src/products/scheduler/etc/campcaster-scheduler.xml deleted file mode 100644 index 46c89727c..000000000 --- a/src/products/scheduler/etc/campcaster-scheduler.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/products/scheduler/etc/campcaster-scheduler.xml.template b/src/products/scheduler/etc/campcaster-scheduler.xml.template deleted file mode 100644 index 0ea00e188..000000000 --- a/src/products/scheduler/etc/campcaster-scheduler.xml.template +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/products/scheduler/etc/configure.ac b/src/products/scheduler/etc/configure.ac deleted file mode 100644 index d5bbf1257..000000000 --- a/src/products/scheduler/etc/configure.ac +++ /dev/null @@ -1,312 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(Campcaster-Scheduler, 0.0, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../src/main.cxx) - -AC_CONFIG_HEADERS(configure.h) -AC_PROG_CXX() - -AC_CHECK_HEADERS(sys/types.h unistd.h getopt.h signal.h sys/stat.h time.h) -AC_CHECK_HEADERS(stdio.h fcntl.h sys/time.h) - -AC_CHECK_HEADERS(libtar.h) - - -dnl----------------------------------------------------------------------------- -dnl specify whether debug info should be compiled into the executable -dnl----------------------------------------------------------------------------- -AC_SUBST(CXXFLAGS) - -AC_ARG_ENABLE([debug], - AC_HELP_STRING([--enable-debug], [compile with debug info (no)]), - [], - [enable_debug=no]) - -if test "x${enable_debug}" = "xyes"; then - CXXFLAGS="-g -O0" - AC_DEFINE( YDEBUG, 1, [Debug is on] ) -else - CXXFLAGS="-O3" -fi - -AC_MSG_RESULT([using compiler options: ${CXXFLAGS}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the pkg-config path -dnl----------------------------------------------------------------------------- -AC_ARG_WITH([pkg-config-path], - AC_HELP_STRING([--with-pkg-config-path], - [use the pkg-config path (prefix/lib/pkgconfig)]), - [PKG_CONFIG_PATH=${withval}], - [PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:$PKG_CONFIG_PATH]) - -AC_MSG_RESULT([using pkg-config path: ${PKG_CONFIG_PATH}]) - -export PKG_CONFIG_PATH - -export PATH=${prefix}/bin:${PATH} - - -AX_BOOST_BASE([1.33.1]) -if test "x${BOOST_CPPFLAGS}" != "x"; then - AX_BOOST_DATE_TIME - if test "x${BOOST_DATE_TIME_LIB}" = "x"; then - AC_MSG_ERROR([Boost date-time library not found]) - fi -else - AC_MSG_ERROR([Boost library >= 1.33.1 not found]) -fi - -PKG_CHECK_MODULES(LIBXMLPP,[libxml++-2.6 >= 2.8.1]) -AC_SUBST(LIBXMLPP_CFLAGS) -AC_SUBST(LIBXMLPP_LIBS) - -PKG_CHECK_MODULES(LIBODBCXX,[libodbc++]) - -PKG_CHECK_MODULES(GSTREAMER,[gstreamer-0.10 >= 0.10]) -AC_SUBST(GSTREAMER_CFLAGS) -AC_SUBST(GSTREAMER_LIBS) - -PKG_CHECK_MODULES(GSTCONTROLLER,[gstreamer-controller-0.10 >= 0.10]) -AC_SUBST(GSTCONTROLLER_CFLAGS) -AC_SUBST(GSTCONTROLLER_LIBS) - -AC_CHECK_CURL(7.12.3) -AC_SUBST(CURL_CFLAGS) -AC_SUBST(CURL_LIBS) - -AC_CHECK_TAGLIB(1.3.1) -AC_SUBST(TAGLIB_CFLAGS) -AC_SUBST(TAGLIB_LIBS) - -AC_CHECK_ICU(3.0) -AC_SUBST(ICU_CFLAGS) -AC_SUBST(ICU_CXXFLAGS) -AC_SUBST(ICU_LIBS) - -AC_PATH_PROG(GENRB, genrb) -AC_SUBST(GENRB) - - -dnl----------------------------------------------------------------------------- -dnl enable compilaton for code coverage data -dnl----------------------------------------------------------------------------- -AC_SUBST(COVERAGE_CXXFLAGS) - -AC_ARG_ENABLE( coverage, -[ --enable-coverage enable code coverage data generaton (no) ], - ENABLE_COVERAGE=${enableval}, ENABLE_COVERAGE="no" ) - -if test "x${ENABLE_COVERAGE}" == "xyes" ; then - COVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage" - AC_MSG_RESULT([compiling in code coverage mode]) -else - AC_MSG_RESULT([not compiling in code coverage mode]) -fi - - -dnl----------------------------------------------------------------------------- -dnl specify wether the Campcaster database and user should be created -dnl----------------------------------------------------------------------------- -AC_SUBST(CREATE_LS_DATABASE) - -AC_ARG_WITH([create-database], - AC_HELP_STRING([--with-create-database], - [specify wether the Campcaster database and database user - should be created (no)]), - [CREATE_LS_DATABASE=${withval}], - [CREATE_LS_DATABASE=no]) - -AC_MSG_RESULT([creating Campcaster database: ${CREATE_LS_DATABASE}]) - - -dnl----------------------------------------------------------------------------- -dnl specify wether the ODBC data source should be created -dnl----------------------------------------------------------------------------- -AC_SUBST(CREATE_ODBC_DATA_SOURCE) - -AC_ARG_WITH([create-odbc-data-source], - AC_HELP_STRING([--with-create-odbc-data-source], - [specify wether the ODBC data source for Campcaster should be - created (no)]), - [CREATE_ODBC_DATA_SOURCE=${withval}], - [CREATE_ODBC_DATA_SOURCE=no]) - -AC_MSG_RESULT([creating ODBC data source: ${CREATE_ODBC_DATA_SOURCE}]) - - -dnl----------------------------------------------------------------------------- -dnl specify wether the Campcaster database tables should be initialized -dnl----------------------------------------------------------------------------- -AC_SUBST(INIT_LS_DATABASE) - -AC_ARG_WITH([init-database], - AC_HELP_STRING([--with-init-database], - [specify wether the Campcaster database tables should be - initialized (no)]), - [INIT_LS_DATABASE=${withval}], - [INIT_LS_DATABASE=no]) - -AC_MSG_RESULT([initializing Campcaster database: ${INIT_LS_DATABASE}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the FQDN -dnl----------------------------------------------------------------------------- -AC_SUBST(HOSTNAME) - -AC_ARG_WITH([hostname], - AC_HELP_STRING([--with-hostname], - [use the specified hostname (guess)]), - [HOSTNAME=${withval}], [HOSTNAME=`hostname -f`]) - -AC_MSG_RESULT([using hostname: ${HOSTNAME}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the web server port -dnl----------------------------------------------------------------------------- -AC_SUBST(WWW_PORT) - -AC_ARG_WITH([www-port], - AC_HELP_STRING([--with-www-port], - [use the specified www port (80)]), - [WWW_PORT=${withval}], [WWW_PORT=80]) - -AC_MSG_RESULT([using www port: ${WWW_PORT}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the scheduler server port -dnl----------------------------------------------------------------------------- -AC_SUBST(SCHEDULER_PORT) - -AC_ARG_WITH([scheduler-port], - AC_HELP_STRING([--with-scheduler-port], - [use the specified scheduler port (3344)]), - [SCHEDULER_PORT=${withval}], [SCHEDULER_PORT=3344]) - -AC_MSG_RESULT([using scheduler port: ${SCHEDULER_PORT}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the database server name -dnl----------------------------------------------------------------------------- -AC_SUBST(DB_SERVER) - -AC_ARG_WITH([database-server], - AC_HELP_STRING([--with-database-server], - [use the specified database server (localhost)]), - [DB_SERVER=${withval}], [DB_SERVER=localhost]) - -AC_MSG_RESULT([using database server: ${DB_SERVER}]) - - -dnl----------------------------------------------------------------------------- -dnl get the name of the Campcaster database -dnl----------------------------------------------------------------------------- -AC_SUBST(DATABASE) - -AC_ARG_WITH([database], - AC_HELP_STRING([--with-database], - [the name of the postgresql database to use (Campcaster)]), - [DATABASE=${withval}], [DATABASE=Campcaster]) - -AC_MSG_RESULT([using database: ${DATABASE}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the database server user -dnl----------------------------------------------------------------------------- -AC_SUBST(DB_USER) - -AC_ARG_WITH([database-user], - AC_HELP_STRING([--with-database-user], - [use the specified database server user (campcaster)]), - [DB_USER=${withval}], [DB_USER=campcaster]) - -AC_MSG_RESULT([using database server user: ${DB_USER}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the database server user password -dnl----------------------------------------------------------------------------- -AC_SUBST(DB_PASSWORD) - -AC_ARG_WITH([database-password], - AC_HELP_STRING([--with-database-password], - [use the specified database server user password (campcaster)]), - [DB_PASSWORD=${withval}], [DB_PASSWORD=campcaster]) - -AC_MSG_RESULT([using database server user password: ${DB_PASSWORD}]) - - -dnl----------------------------------------------------------------------------- -dnl specify the audio output device -dnl----------------------------------------------------------------------------- -AC_SUBST(AUDIO_OUT) - -AC_ARG_WITH([audio-out], - AC_HELP_STRING([--with-audio-out], - [use the specified audio output device, either ALSA or OSS - (default)]), - [AUDIO_OUT=${withval}], [AUDIO_OUT=default]) - -AC_MSG_RESULT([using audio output device: ${AUDIO_OUT}]) - - -dnl display status info on what libraries will get compiled - -AC_MSG_NOTICE( -[using the following configuration settings: - - hostname: ${HOSTNAME} - www port: ${WWW_PORT} - scheduler port: ${SCHEDULER_PORT} - database server: ${DB_SERVER} - database name: ${DATABASE} - database user: ${DB_USER} - database user password: ${DB_PASSWORD} - audio output device: ${AUDIO_OUT} - creating Campcaster database: ${CREATE_LS_DATABASE} - creating ODBC data source: ${CREATE_ODBC_DATA_SOURCE} - initialize Campcaster database: ${INIT_LS_DATABASE} - -]) - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() diff --git a/src/products/scheduler/etc/connectionManagerFactory.xml b/src/products/scheduler/etc/connectionManagerFactory.xml deleted file mode 100644 index 9e7c74905..000000000 --- a/src/products/scheduler/etc/connectionManagerFactory.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - -]> - - - diff --git a/src/products/scheduler/etc/doxygen.config b/src/products/scheduler/etc/doxygen.config deleted file mode 100644 index 9c076c81e..000000000 --- a/src/products/scheduler/etc/doxygen.config +++ /dev/null @@ -1,1140 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -# Doxyfile 1.3.6 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = Campcaster - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 0.0 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = doc/doxygen - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, -# Finnish, French, German, Greek, Hungarian, Italian, Japanese, Japanese-en -# (Japanese with English messages), Korean, Korean-en, Norwegian, Polish, Portuguese, -# Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. - -OUTPUT_LANGUAGE = English - -# This tag can be used to specify the encoding used in the generated output. -# The encoding is not always determined by the language that is chosen, -# but also whether or not the output is meant for Windows or non-Windows users. -# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES -# forces the Windows encoding (this is the default for the Windows binary), -# whereas setting the tag to NO uses a Unix-style encoding (the default for -# all platforms other than Windows). - -USE_WINDOWS_ENCODING = NO - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is used -# as the annotated text. Otherwise, the brief description is used as-is. If left -# blank, the following values are used ("$name" is automatically replaced with the -# name of the entity): "The $name class" "The $name widget" "The $name file" -# "is" "provides" "specifies" "contains" "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all inherited -# members of a class in the documentation of that class as if those members were -# ordinary class members. Constructors, destructors and assignment operators of -# the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = NO - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. It is allowed to use relative paths in the argument list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like the Qt-style comments (thus requiring an -# explicit @brief command for a brief description. - -JAVADOC_AUTOBRIEF = YES - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = YES - -# If the DETAILS_AT_TOP tag is set to YES then Doxygen -# will output the detailed description near the top, like JavaDoc. -# If set to NO, the detailed description appears after the member -# documentation. - -DETAILS_AT_TOP = YES - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources -# only. Doxygen will then generate output that is more tailored for Java. -# For instance, namespaces will be presented as packages, qualified scopes -# will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = NO - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# users are advised to set this option to NO. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp -# *.h++ *.idl *.odl *.cs *.php *.php3 *.inc - -FILE_PATTERNS = - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or directories -# that are symbolic links (a Unix filesystem feature) are excluded from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. - -EXCLUDE_PATTERNS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. - -INPUT_FILTER = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES (the default) -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES (the default) -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be -# generated containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, -# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are -# probably better off using the HTML help feature. - -GENERATE_TREEVIEW = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = YES - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_PREDEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse the -# parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = \ -../../doc/doxygen/xmlrpc++.tag=../../../../../usr/share/doc/xmlrpc++ - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = YES - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base or -# super classes. Setting the tag to NO turns the diagrams off. Note that this -# option is superseded by the HAVE_DOT option below. This is only a fallback. It is -# recommended to install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = YES - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = NO - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will -# generate a call dependency graph for every global function or class method. -# Note that enabling this option will significantly increase the time of a run. -# So in most cases it will be better to enable call graphs for selected -# functions only using the \callgraph command. - -CALL_GRAPH = NO - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found on the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_WIDTH = 1024 - -# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height -# (in pixels) of the graphs generated by dot. If a graph becomes larger than -# this value, doxygen will try to truncate the graph, so that it fits within -# the specified constraint. Beware that most browsers cannot cope with very -# large images. - -MAX_DOT_GRAPH_HEIGHT = 1024 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes that -# lay further from the root node will be omitted. Note that setting this option to -# 1 or 2 may greatly reduce the computation time needed for large code bases. Also -# note that a graph may be further truncated if the graph's image dimensions are -# not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH and MAX_DOT_GRAPH_HEIGHT). -# If 0 is used for the depth value (the default), the graph is not depth-constrained. - -MAX_DOT_GRAPH_DEPTH = 0 - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- - -# The SEARCHENGINE tag specifies whether or not a search engine should be -# used. If set to NO the values of all tags below this one will be ignored. - -SEARCHENGINE = NO diff --git a/src/products/scheduler/etc/odbc_template b/src/products/scheduler/etc/odbc_template deleted file mode 100644 index 60e80415d..000000000 --- a/src/products/scheduler/etc/odbc_template +++ /dev/null @@ -1,18 +0,0 @@ -[ls_database] -Description = the Campcaster database at PostgreSQL -Driver = PostgreSQL_Campcaster -Trace = No -TraceFile = /tmp/sql.log -Database = ls_database -Servername = ls_dbserver -Username = -Password = -Port = 5432 -Protocol = 6.4 -ReadOnly = No -RowVersioning = No -ShowSystemTables = No -ShowOidColumn = No -FakeOidIndex = No -ConnSettings = - diff --git a/src/products/scheduler/etc/odbc_test_template b/src/products/scheduler/etc/odbc_test_template deleted file mode 100644 index a2de7cc58..000000000 --- a/src/products/scheduler/etc/odbc_test_template +++ /dev/null @@ -1,18 +0,0 @@ -[LiveSupport-test] -Description = the Campcaster database at PostgreSQL -Driver = PostgreSQL -Trace = No -TraceFile = /tmp/sql.log -Database = Campcaster-test -Servername = localhost -Username = -Password = -Port = 5432 -Protocol = 6.4 -ReadOnly = No -RowVersioning = No -ShowSystemTables = No -ShowOidColumn = No -FakeOidIndex = No -ConnSettings = - diff --git a/src/products/scheduler/etc/odbcinst_new_debian_template b/src/products/scheduler/etc/odbcinst_new_debian_template deleted file mode 100644 index eb4b77764..000000000 --- a/src/products/scheduler/etc/odbcinst_new_debian_template +++ /dev/null @@ -1,5 +0,0 @@ -[PostgreSQL_Campcaster] -Description = PostgreSQL driver for Campcaster -Driver = /usr/lib/odbc/psqlodbcw.so -Setup = /usr/lib/odbc/libodbcpsqlS.so - diff --git a/src/products/scheduler/etc/odbcinst_old_debian_template b/src/products/scheduler/etc/odbcinst_old_debian_template deleted file mode 100644 index b21c5e27c..000000000 --- a/src/products/scheduler/etc/odbcinst_old_debian_template +++ /dev/null @@ -1,5 +0,0 @@ -[PostgreSQL_Campcaster] -Description = PostgreSQL driver for Campcaster -Driver = /usr/lib/odbc/psqlodbc.so -Setup = /usr/lib/odbc/libodbcpsqlS.so - diff --git a/src/products/scheduler/etc/odbcinst_template b/src/products/scheduler/etc/odbcinst_template deleted file mode 100644 index dfd9d84d6..000000000 --- a/src/products/scheduler/etc/odbcinst_template +++ /dev/null @@ -1,5 +0,0 @@ -[PostgreSQL_Campcaster] -Description = PostgreSQL driver for Campcaster -Driver = /usr/lib/libodbcpsql.so -Setup = /usr/lib/libodbcpsqlS.so - diff --git a/src/products/scheduler/etc/playLogFactory.xml b/src/products/scheduler/etc/playLogFactory.xml deleted file mode 100644 index 2fd65fe9a..000000000 --- a/src/products/scheduler/etc/playLogFactory.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - -]> - - - diff --git a/src/products/scheduler/etc/playlist.xml b/src/products/scheduler/etc/playlist.xml deleted file mode 100644 index 7a4a3ef41..000000000 --- a/src/products/scheduler/etc/playlist.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - diff --git a/src/products/scheduler/etc/scheduleFactory.xml b/src/products/scheduler/etc/scheduleFactory.xml deleted file mode 100644 index a89f05373..000000000 --- a/src/products/scheduler/etc/scheduleFactory.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - -]> - - - diff --git a/src/products/scheduler/etc/storageClient.xml b/src/products/scheduler/etc/storageClient.xml deleted file mode 100644 index 9ad61269a..000000000 --- a/src/products/scheduler/etc/storageClient.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - diff --git a/src/products/scheduler/etc/testAuthenticationClient.xml b/src/products/scheduler/etc/testAuthenticationClient.xml deleted file mode 100644 index 7a1580f07..000000000 --- a/src/products/scheduler/etc/testAuthenticationClient.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - -]> - - - - - diff --git a/src/products/scheduler/etc/testResultToHtml.xsl b/src/products/scheduler/etc/testResultToHtml.xsl deleted file mode 100644 index f9e893521..000000000 --- a/src/products/scheduler/etc/testResultToHtml.xsl +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - Campcaster unit test results - - -

Preface

-This document is part of the -Campcaster -project, Copyright © 2004 Media -Development Loan Fund, under the GNU -GPL. -
-This is an automatically generated document. -

Scope

-This document contains the generated unit test results for the -Campcaster project. -

Summary

- - - - - - - - - - - - - - - - - - -
Total number of tests:
Tests passed:
Tests failed:
Test errors:
-
-

Tests

- - - - - - - - - - - - - -
test nametest status
failedpassed
- - -
- -
- diff --git a/src/products/scheduler/etc/testStorageClient.xml b/src/products/scheduler/etc/testStorageClient.xml deleted file mode 100644 index 9ad61269a..000000000 --- a/src/products/scheduler/etc/testStorageClient.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - -]> - - - - - - - - - - - - - - diff --git a/src/products/scheduler/etc/webAuthenticationClient.xml b/src/products/scheduler/etc/webAuthenticationClient.xml deleted file mode 100644 index a63a04718..000000000 --- a/src/products/scheduler/etc/webAuthenticationClient.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - -]> - - - - - diff --git a/src/products/scheduler/etc/webStorageClient.xml b/src/products/scheduler/etc/webStorageClient.xml deleted file mode 100644 index 2b9440524..000000000 --- a/src/products/scheduler/etc/webStorageClient.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - -]> - - - - - diff --git a/src/products/scheduler/src/BackupFactory.cxx b/src/products/scheduler/src/BackupFactory.cxx deleted file mode 100644 index a43ca5241..000000000 --- a/src/products/scheduler/src/BackupFactory.cxx +++ /dev/null @@ -1,120 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "ScheduleFactory.h" -#include "PostgresqlBackup.h" - -#include "BackupFactory.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string BackupFactory::configElementNameStr = "backupFactory"; - -/*------------------------------------------------------------------------------ - * The singleton instance of BackupFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref BackupFactory::singleton; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance to BackupFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref -BackupFactory :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new BackupFactory()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the backup factory. - *----------------------------------------------------------------------------*/ -void -BackupFactory :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - backup.reset(); - - Ptr::Ref - cmf = ConnectionManagerFactory::getInstance(); - Ptr::Ref - connection = cmf->getConnectionManager(); - - Ptr::Ref - scf = StorageClientFactory::getInstance(); - Ptr::Ref - storage = scf->getStorageClient(); - - Ptr::Ref - sf = ScheduleFactory::getInstance(); - Ptr::Ref - schedule = sf->getSchedule(); - - // try to look for a PostgresqlBackup configuration element - xmlpp::Node::NodeList nodes = - element.get_children(PostgresqlBackup::getConfigElementName()); - if (nodes.size() >= 1) { - const xmlpp::Element * configElement = - dynamic_cast (*(nodes.begin())); - Ptr::Ref pb(new PostgresqlBackup(connection, - storage, - schedule)); - pb->configure(*configElement); - backup = pb; - } - - if (!backup) { - throw std::invalid_argument("could not configure BackupFactory"); - } -} diff --git a/src/products/scheduler/src/BackupFactory.h b/src/products/scheduler/src/BackupFactory.h deleted file mode 100644 index f489dbabc..000000000 --- a/src/products/scheduler/src/BackupFactory.h +++ /dev/null @@ -1,175 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BackupFactory_h -#define BackupFactory_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#include - -#include "LiveSupport/Core/Configurable.h" -#include "BackupInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The factory to create backup objects. - * - * Backup objects are objects which implement the BackupInterface interface, - * so they can create and restore schedule backups. - * - * This object has to be configured with an element that contains - * the configuration element that the factory should build. - * Currently only PostgresqlBackup is supported by this factory. - * - * An example configuration element is the following: - * - *

- *      <backupFactory>
- *          <postgresqlBackup/>
- *      </backupFactory>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT backupFactory (postgresqlBackup) >
- *  
- * - * For details on the <postgresqlBackup> element, see the - * PostgresqlBackup documentation. - * - * @see PostgresqlBackup - */ -class BackupFactory : virtual public Configurable -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The backup created by this factory. - */ - Ptr::Ref backup; - - /** - * The default constructor. - */ - BackupFactory(void) throw() - { - } - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~BackupFactory(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Return a backup. - * - * @return the appropriate backup, according to the - * configuration of this factory. - */ - Ptr::Ref - getBackup(void) throw () - { - return backup; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Storage -} // namespace LiveSupport - -#endif // BackupFactory_h - diff --git a/src/products/scheduler/src/BackupInterface.h b/src/products/scheduler/src/BackupInterface.h deleted file mode 100644 index fe27c1176..000000000 --- a/src/products/scheduler/src/BackupInterface.h +++ /dev/null @@ -1,183 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BackupInterface_h -#define BackupInterface_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Playlist.h" -#include "LiveSupport/Core/ScheduleEntry.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The generic interface for creating and restoring schedule backups. - * - * There is a singleton instance of this type, which is manufactured by the - * BackupFactory class. - * - * There are separate xxxxMethod classes which perform these - * functions via XML-RPC, by delegating them to this singleton object. - * The xxxxMethod classes are registered in the SchedulerDaemon - * object, which calls them when an XML-RPC request is received. - * - */ -class BackupInterface -{ - public: - /** - * Start to create a backup by calling the storage, and also - * adding a backup of the schedule. - * To check if the backup procedure is still pending, call - * createBackupCheck() regularly. - * Make sure to close the backup by calling createBackupClose(). - * - * @param sessionId a valid session ID to use for accessing the - * storage - * @param criteria the criteria to use for backing up the storage - * @param fromTime entries are included in the schedule export starting - * from this time. - * @param toTime entries as included in the schedule export - * up to but not including this time. - * @return a token, which can be used to query the backup process. - * @exception XmlRpcException on XML-RPC issues. - * @see #createBackupCheck - * @see #createBackupClose - */ - virtual Ptr::Ref - createBackupOpen(Ptr::Ref sessionId, - Ptr::Ref criteria, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (XmlRpcException) - = 0; - - /** - * Check the status of a storage backup. - * - * @param token the identifier of this backup task. - * @param url return parameter; - * if the status is "success", it contains the - * URL of the created backup file. - * @param path return parameter; - * if the status is "success", it contains the - * local access path of the created backup file. - * @param errorMessage return parameter; - * if the status is "fault", it contains the - * fault string. - * @return the state of the backup process: one of pendingState, - * finishedState, or failedState. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - * @see #createBackupOpen - * @see #createBackupClose - */ - virtual AsyncState - createBackupCheck(const Glib::ustring & token, - Ptr::Ref & url, - Ptr::Ref & path, - Ptr::Ref & errorMessage) - throw (XmlRpcException) - = 0; - - /** - * Close the storage backup process. - * Frees up all resources allocated to the backup. - * - * @param token the identifier of this backup task. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - * @see #createBackupOpen - * @see #createBackupCheck - */ - virtual void - createBackupClose(const Glib::ustring & token) - throw (XmlRpcException) - = 0; - - /** - * Restore a schedule backup. - * - * All playlist IDs contained in the backup should already be in the - * storage. If this is a combined backup, with both storage and - * schedule components, then restore this backup to the storage - * first, and then call this function. - * - * @param sessionId a valid session ID to identify the user. - * @param path the location of the archive to upload. - * @exception XmlRpcException if there is an error. - */ - virtual void - restoreBackup(Ptr::Ref sessionId, - Ptr::Ref path) - throw (XmlRpcException) - = 0; - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~BackupInterface(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // BackupInterface_h - diff --git a/src/products/scheduler/src/BaseTestMethod.cxx b/src/products/scheduler/src/BaseTestMethod.cxx deleted file mode 100644 index 0204ff28d..000000000 --- a/src/products/scheduler/src/BaseTestMethod.cxx +++ /dev/null @@ -1,87 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include "SchedulerDaemon.h" -#include "BaseTestMethod.h" - - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The XML-RPC host to connect to. - *----------------------------------------------------------------------------*/ -std::string LiveSupport::Scheduler::BaseTestMethod::xmlRpcHost; - -/*------------------------------------------------------------------------------ - * The XML-RPC port number to connect to. - *----------------------------------------------------------------------------*/ -unsigned int LiveSupport::Scheduler::BaseTestMethod::xmlRpcPort; - -/*------------------------------------------------------------------------------ - * A flag to indicate if configuration has already been done. - *----------------------------------------------------------------------------*/ -bool LiveSupport::Scheduler::BaseTestMethod::configured = false; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Read configuration information. - *----------------------------------------------------------------------------*/ -void -LiveSupport::Scheduler:: -BaseTestMethod :: configure(std::string configFileName) - throw (std::exception) -{ - if (!configured) { - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - - try { - std::auto_ptr - parser(new xmlpp::DomParser(configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - scheduler->configure(*(document->get_root_node())); - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in configuration file" << std::endl - << e.what() << std::endl; - } catch (xmlpp::exception &e) { - std::cerr << "error parsing configuration file" << std::endl - << e.what() << std::endl; - } - - xmlRpcHost = scheduler->getXmlRpcHost(); - xmlRpcPort = scheduler->getXmlRpcPort(); - configured = true; - } -} - diff --git a/src/products/scheduler/src/BaseTestMethod.h b/src/products/scheduler/src/BaseTestMethod.h deleted file mode 100644 index a9b244aa0..000000000 --- a/src/products/scheduler/src/BaseTestMethod.h +++ /dev/null @@ -1,127 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef BaseTestMethod_h -#define BaseTestMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/BaseTestMethod.h" - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A base class for the test methods. - * Subclass this class for the methods that connect to an XML-RPC source. - * Make sure to call BaseTestMethod::configure() before running the - * test cases. - * - */ -class BaseTestMethod : public LiveSupport::Core::BaseTestMethod -{ - private: - /** - * The XML-RPC host name to connect to. - */ - static std::string xmlRpcHost; - - /** - * The XML-RPC port to connect to. - */ - static unsigned int xmlRpcPort; - - /** - * A flag to indicate if configuration has already been done. - */ - static bool configured; - - - public: - - /** - * Function to read configuration information, and fill out - * relevant attributes, such as the XML-RPC port and host. - * - * @param configFileName the name of the configuration file to read. - * @exception std::exception in case of errors reading the - * configuration file - */ - static void - configure(std::string configFileName) - throw (std::exception); - - /** - * Return the XML-RPC port to connect to. - * - * @return the XML-RPC port to connect to. - */ - static unsigned int - getXmlRpcPort(void) throw () - { - return xmlRpcPort; - } - - /** - * Return the XML-RPC host to connect to. - * - * @return the XML-RPC host to connect to. - */ - static std::string - getXmlRpcHost(void) throw () - { - return xmlRpcHost; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // BaseTestMethod_h - diff --git a/src/products/scheduler/src/CreateBackupCheckMethod.cxx b/src/products/scheduler/src/CreateBackupCheckMethod.cxx deleted file mode 100644 index 55c9f257d..000000000 --- a/src/products/scheduler/src/CreateBackupCheckMethod.cxx +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include - -#include "LiveSupport/Core/XmlRpcTools.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "BackupFactory.h" - -#include "CreateBackupCheckMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string CreateBackupCheckMethod::methodName = "createBackupCheck"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int CreateBackupCheckMethod::errorId = 4100; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -CreateBackupCheckMethod :: CreateBackupCheckMethod ( - Ptr::Ref xmlRpcServer) - throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the upload playlist method XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -CreateBackupCheckMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref token; - try{ - token = XmlRpcTools::extractToken(parameters); - - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, - "missing token argument", - returnValue); - return; - } - - Ptr::Ref bf = BackupFactory::getInstance(); - Ptr::Ref backup = bf->getBackup(); - - Ptr::Ref url; - Ptr::Ref path; - Ptr::Ref errorMessage; - AsyncState state; - try { - state = backup->createBackupCheck(*token, url, path, errorMessage); - - } catch (Core::XmlRpcException &e) { - XmlRpcTools::markError(errorId+10, e.what(), returnValue); - return; - } - - XmlRpcTools::backupStatusToXmlRpcValue(state, returnValue); - - if (state == AsyncState::finishedState) { - if (url && path) { - XmlRpcTools::urlToXmlRpcValue(url, returnValue); - XmlRpcTools::pathToXmlRpcValue(path, returnValue); - } else { - XmlRpcTools::markError(errorId+11, - "missing url or path return value", - returnValue); - return; - } - - } else if (state == AsyncState::failedState) { - if (errorMessage) { - XmlRpcTools::faultStringToXmlRpcValue(errorMessage, returnValue); - } else { - XmlRpcTools::markError(errorId+11, - "missing faultString return value", - returnValue); - return; - } - } -} - diff --git a/src/products/scheduler/src/CreateBackupCheckMethod.h b/src/products/scheduler/src/CreateBackupCheckMethod.h deleted file mode 100644 index 71aac9435..000000000 --- a/src/products/scheduler/src/CreateBackupCheckMethod.h +++ /dev/null @@ -1,152 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef CreateBackupCheckMethod_h -#define CreateBackupCheckMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to check the progress of a backup creation process. - * - * The name of the method when called through XML-RPC is "createBackupCheck". - * - * The expected parameter is an XML-RPC structure with a single member: - *
    - *
  • token - string - the token obtained from createBackupOpen
  • - *
- * - * On success, returns an XML-RPC struct, with the following members: - *
    - *
  • status - string - on of "success", "working" or "fault"
  • - *
  • url - string - if the status is "success", this contains - * a readable URL of the new backup archive
  • - *
  • path - string - if the status is "success", this contains - * the local access path of the new backup - * archive
  • - *
  • faultString - string - if the status is "fault", this contains - * the error message.
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 4101 - invalid argument format
  • - *
  • 4102 - missing token argument
  • - *
  • 4110 - error reported by the scheduler daemon
  • - *
  • 4111 - syntax error in the values returned by - * the scheduler daemon
  • - *
- * - */ -class CreateBackupCheckMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - CreateBackupCheckMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - CreateBackupCheckMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the createBackupOpen command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // CreateBackupCheckMethod_h - diff --git a/src/products/scheduler/src/CreateBackupCloseMethod.cxx b/src/products/scheduler/src/CreateBackupCloseMethod.cxx deleted file mode 100644 index d1d746b7a..000000000 --- a/src/products/scheduler/src/CreateBackupCloseMethod.cxx +++ /dev/null @@ -1,121 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "LiveSupport/Core/XmlRpcTools.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "BackupFactory.h" - -#include "CreateBackupCloseMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string CreateBackupCloseMethod::methodName = "createBackupClose"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int CreateBackupCloseMethod::errorId = 4200; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -CreateBackupCloseMethod :: CreateBackupCloseMethod( - Ptr::Ref xmlRpcServer) - throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the upload playlist method XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -CreateBackupCloseMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref token; - try{ - token = XmlRpcTools::extractToken(parameters); - - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, - "missing token argument", - returnValue); - return; - } - - Ptr::Ref bf = BackupFactory::getInstance(); - Ptr::Ref backup = bf->getBackup(); - - try { - backup->createBackupClose(*token); - - } catch (Core::XmlRpcException &e) { - XmlRpcTools::markError(errorId+10, e.what(), returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/CreateBackupCloseMethod.h b/src/products/scheduler/src/CreateBackupCloseMethod.h deleted file mode 100644 index af3435ac3..000000000 --- a/src/products/scheduler/src/CreateBackupCloseMethod.h +++ /dev/null @@ -1,136 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef CreateBackupCloseMethod_h -#define CreateBackupCloseMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to close the backup creation process. - * - * The name of the method when called through XML-RPC is "createBackupClose". - * - * The expected parameter is an XML-RPC structure with a single member: - *
    - *
  • token - string - the token obtained from createBackupOpen
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 4201 - invalid argument format
  • - *
  • 4202 - missing token argument
  • - *
  • 4210 - error reported by the scheduler daemon
  • - *
- * - */ -class CreateBackupCloseMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - CreateBackupCloseMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - CreateBackupCloseMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the createBackupOpen command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // CreateBackupCloseMethod_h - diff --git a/src/products/scheduler/src/CreateBackupOpenMethod.cxx b/src/products/scheduler/src/CreateBackupOpenMethod.cxx deleted file mode 100644 index 3db27c368..000000000 --- a/src/products/scheduler/src/CreateBackupOpenMethod.cxx +++ /dev/null @@ -1,152 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "LiveSupport/Core/XmlRpcTools.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "BackupFactory.h" - -#include "CreateBackupOpenMethod.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string CreateBackupOpenMethod::methodName = "createBackupOpen"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int CreateBackupOpenMethod::errorId = 4000; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -CreateBackupOpenMethod :: CreateBackupOpenMethod( - Ptr::Ref xmlRpcServer) - throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the upload playlist method XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -CreateBackupOpenMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref criteria; - try { - criteria = XmlRpcTools::extractSearchCriteria(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, e.what(), returnValue); - return; - } - - Ptr::Ref fromTime; - try { - fromTime = XmlRpcTools::extractFromTime(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, e.what(), returnValue); - return; - } - - Ptr::Ref toTime; - try { - toTime = XmlRpcTools::extractToTime(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+4, e.what(), returnValue); - return; - } - - Ptr::Ref bf = BackupFactory::getInstance(); - Ptr::Ref backup = bf->getBackup(); - - Ptr::Ref token; - try { - token = backup->createBackupOpen(sessionId, - criteria, - fromTime, - toTime); - } catch (Core::XmlRpcException &e) { - XmlRpcTools::markError(errorId+5, e.what(), returnValue); - return; - } - - XmlRpcTools::tokenToXmlRpcValue(token, returnValue); -} - diff --git a/src/products/scheduler/src/CreateBackupOpenMethod.h b/src/products/scheduler/src/CreateBackupOpenMethod.h deleted file mode 100644 index ec9416057..000000000 --- a/src/products/scheduler/src/CreateBackupOpenMethod.h +++ /dev/null @@ -1,158 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef CreateBackupOpenMethod_h -#define CreateBackupOpenMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to start a backup creation process. - * - * The name of the method when called through XML-RPC is "createBackupOpen". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • criteria - struct - the criteria to use for backing up the - * storage
  • - *
  • fromTime - datetime - entries are included in the schedule export - * starting from this time
  • - *
  • toTime - datetime - entries are included in the schedule export - * up to but not including this time
  • - *
- * - * For the format of the criteria parameter, see the - * documentation of XR_LocStor::xr_searchMetadata(). - * - * On success, returns an XML-RPC struct with a single field: - *
    - *
  • token - string - a token, which can be used to query the - * backup process
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 4001 - invalid argument format
  • - *
  • 4002 - missing criteria argument
  • - *
  • 4003 - missing fromTime argument
  • - *
  • 4004 - missing toTime argument
  • - *
  • 4010 - error reported by the scheduler daemon
  • - *
  • 4020 - missing session ID argument
  • - *
- * - */ -class CreateBackupOpenMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - CreateBackupOpenMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - CreateBackupOpenMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the createBackupOpen command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // CreateBackupOpenMethod_h - diff --git a/src/products/scheduler/src/DisplayScheduleMethod.cxx b/src/products/scheduler/src/DisplayScheduleMethod.cxx deleted file mode 100644 index a0f6f1069..000000000 --- a/src/products/scheduler/src/DisplayScheduleMethod.cxx +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "ScheduleInterface.h" -#include "ScheduleFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "DisplayScheduleMethod.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string DisplayScheduleMethod::methodName = "displaySchedule"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int DisplayScheduleMethod::errorId = 1100; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -DisplayScheduleMethod :: DisplayScheduleMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the stop XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -DisplayScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref fromTime; - try { - fromTime = XmlRpcTools::extractFromTime(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing or invalid 'from' argument", - returnValue); - return; - } - - Ptr::Ref toTime; - try { - toTime = XmlRpcTools::extractToTime(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "missing or invalid 'to' argument", - returnValue); - return; - } - - Ptr::Ref sf = ScheduleFactory::getInstance(); - Ptr::Ref schedule = sf->getSchedule(); - - Ptr::Ref> >::Ref scheduleEntries - = schedule->getScheduleEntries(fromTime, toTime); - -std::cout << "DisplayScheduleMethod scheduleEntries: " << scheduleEntries->size() << std::endl; - - XmlRpcTools::scheduleEntriesToXmlRpcValue(scheduleEntries, returnValue); -} diff --git a/src/products/scheduler/src/DisplayScheduleMethod.h b/src/products/scheduler/src/DisplayScheduleMethod.h deleted file mode 100644 index 5745a49f1..000000000 --- a/src/products/scheduler/src/DisplayScheduleMethod.h +++ /dev/null @@ -1,165 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef DisplayScheduleMethod_h -#define DisplayScheduleMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/ScheduleEntry.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to return the schedule for a specified - * time interval. - * - * The name of the method when called through XML-RPC is "displaySchedule". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • from - datetime - the start of the interval to list schedule from, - * inclusive.
  • - *
  • to - datetime - the end of the interval to list schedule from, - * non-inclusive.
  • - *
- * - * The XML-RPC function returns an XML-RPC array, containing a structure - * for each scheduled item in the interval. An array of size 0 means there - * are not scheduled entries. Each structure is as follows: - *
    - *
  • id - int - the id of the scheduled entry
  • - *
  • playlistId - string - the id of the playlist associated with the entry - *
  • - *
  • start - datetime - the start of the scheduled item
  • - *
  • end - datetime - the end of the scheduled item
  • - *
- * - * The playlistId parameter is a string containing the hexadecimal value of - * the playlist ID. - * It is up to 8 characters long, representing a value between 0 and 2^31-1, - * inclusive. - * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 1101 - invalid argument format
  • - *
  • 1102 - missing or invalid 'from' argument
  • - *
  • 1103 - missing or invalid 'to' argument
  • - *
  • 1120 - missing session ID argument
  • - *
- * - */ -class DisplayScheduleMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - DisplayScheduleMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - DisplayScheduleMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the display schedule command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // DisplayScheduleMethod_h - diff --git a/src/products/scheduler/src/DisplayScheduleMethodTest.cxx b/src/products/scheduler/src/DisplayScheduleMethodTest.cxx deleted file mode 100644 index a0bd87d29..000000000 --- a/src/products/scheduler/src/DisplayScheduleMethodTest.cxx +++ /dev/null @@ -1,409 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" - -#include "SchedulerDaemon.h" -#include "ScheduleFactory.h" -#include "UploadPlaylistMethod.h" -#include "DisplayScheduleMethod.h" -#include "DisplayScheduleMethodTest.h" - -using namespace std; -using namespace XmlRpc; - -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(DisplayScheduleMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -DisplayScheduleMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = scheduler->getStorage(); - storage->reset(); - - schedule = scheduler->getSchedule(); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } - - authentication = scheduler->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } - - insertEntries(); // this can only be called after sessionId is obtained -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -DisplayScheduleMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -DisplayScheduleMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new DisplayScheduleMethod()); - XmlRpcValue parameters; - XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpcValue result; - struct tm time; - - // set up a structure for the parameters - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 18; - time.tm_min = 31; - time.tm_sec = 1; - parameters["from"] = &time; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 19; - time.tm_min = 31; - time.tm_sec = 1; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.size() == 0); -} - - -/*------------------------------------------------------------------------------ - * Insert some entries into the schedule - *----------------------------------------------------------------------------*/ -void -DisplayScheduleMethodTest :: insertEntries(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new UploadPlaylistMethod()); - XmlRpcValue parameters; - XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpcValue result; - struct tm time; - - // insert a playlist for 2004-07-31, at 10 o'clock - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // insert a playlist for 2004-07-31, at 12 o'clock - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 12; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // insert a playlist for 2004-07-31, at 14 o'clock - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 14; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } -} - - -/*------------------------------------------------------------------------------ - * Look at some intervals and check against test data - *----------------------------------------------------------------------------*/ -void -DisplayScheduleMethodTest :: intervalTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new DisplayScheduleMethod()); - XmlRpcValue parameters; - XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpcValue result; - struct tm time; - - // check for the interval 2004-07-31 between 9 and 11 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 9; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 11; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 1); - CPPUNIT_ASSERT(result[0].hasMember("playlistId")); - CPPUNIT_ASSERT(result[0]["playlistId"].getType() - == XmlRpcValue::TypeString); - CPPUNIT_ASSERT(std::string(result[0]["playlistId"]) == "0000000000000001"); - time = result[0]["start"]; - CPPUNIT_ASSERT(time.tm_year == 2004); - CPPUNIT_ASSERT(time.tm_mon == 7); - CPPUNIT_ASSERT(time.tm_mday == 31); - CPPUNIT_ASSERT(time.tm_hour == 10); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - time = result[0]["end"]; - CPPUNIT_ASSERT(time.tm_year == 2004); - CPPUNIT_ASSERT(time.tm_mon == 7); - CPPUNIT_ASSERT(time.tm_mday == 31); - CPPUNIT_ASSERT(time.tm_hour == 11); - CPPUNIT_ASSERT(time.tm_min == 30); - CPPUNIT_ASSERT(time.tm_sec == 0); - - // check for the interval 2004-07-31 between 9 and 13 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 9; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 13; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 2); - CPPUNIT_ASSERT(result[0].hasMember("playlistId")); - CPPUNIT_ASSERT(result[0]["playlistId"].getType() - == XmlRpcValue::TypeString); - CPPUNIT_ASSERT(std::string(result[0]["playlistId"]) == "0000000000000001"); - time = result[0]["start"]; - CPPUNIT_ASSERT(time.tm_year == 2004); - CPPUNIT_ASSERT(time.tm_mon == 7); - CPPUNIT_ASSERT(time.tm_mday == 31); - CPPUNIT_ASSERT(time.tm_hour == 10); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - time = result[0]["end"]; - CPPUNIT_ASSERT(time.tm_year == 2004); - CPPUNIT_ASSERT(time.tm_mon == 7); - CPPUNIT_ASSERT(time.tm_mday == 31); - CPPUNIT_ASSERT(time.tm_hour == 11); - CPPUNIT_ASSERT(time.tm_min == 30); - CPPUNIT_ASSERT(time.tm_sec == 0); - - CPPUNIT_ASSERT(result[1].hasMember("playlistId")); - CPPUNIT_ASSERT(result[1]["playlistId"].getType() - == XmlRpcValue::TypeString); - CPPUNIT_ASSERT(std::string(result[1]["playlistId"]) == "0000000000000001"); - time = result[1]["start"]; - CPPUNIT_ASSERT(time.tm_year == 2004); - CPPUNIT_ASSERT(time.tm_mon == 7); - CPPUNIT_ASSERT(time.tm_mday == 31); - CPPUNIT_ASSERT(time.tm_hour == 12); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - time = result[1]["end"]; - CPPUNIT_ASSERT(time.tm_year == 2004); - CPPUNIT_ASSERT(time.tm_mon == 7); - CPPUNIT_ASSERT(time.tm_mday == 31); - CPPUNIT_ASSERT(time.tm_hour == 13); - CPPUNIT_ASSERT(time.tm_min == 30); - CPPUNIT_ASSERT(time.tm_sec == 0); - - // check for the interval 2004-07-31 between 8 and 9 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 8; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 2004; - time.tm_mon = 7; - time.tm_mday = 31; - time.tm_hour = 9; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 0); -} - - diff --git a/src/products/scheduler/src/DisplayScheduleMethodTest.h b/src/products/scheduler/src/DisplayScheduleMethodTest.h deleted file mode 100644 index e81b6c1b6..000000000 --- a/src/products/scheduler/src/DisplayScheduleMethodTest.h +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef DisplayScheduleMethodTest_h -#define DisplayScheduleMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the DisplayScheduleMethod class. - * - * @see DisplayScheduleMethod - */ -class DisplayScheduleMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(DisplayScheduleMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(intervalTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The schedule used during the test. - */ - Ptr::Ref schedule; - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Insert some entries into the schedule to provide test data. - */ - void - insertEntries(void) throw (CPPUNIT_NS::Exception); - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Look at some intervals, and check them against the test data. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - intervalTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // DisplayScheduleMethodTest_h - diff --git a/src/products/scheduler/src/GeneratePlayReportMethod.cxx b/src/products/scheduler/src/GeneratePlayReportMethod.cxx deleted file mode 100644 index 7ba6820fd..000000000 --- a/src/products/scheduler/src/GeneratePlayReportMethod.cxx +++ /dev/null @@ -1,136 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "PlayLogInterface.h" -#include "PlayLogFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "GeneratePlayReportMethod.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string GeneratePlayReportMethod::methodName = "generatePlayReport"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int GeneratePlayReportMethod::errorId = 1500; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -GeneratePlayReportMethod :: GeneratePlayReportMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the stop XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -GeneratePlayReportMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref fromTime; - try { - fromTime = XmlRpcTools::extractFromTime(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing or invalid 'from' argument", - returnValue); - return; - } - - Ptr::Ref toTime; - try { - toTime = XmlRpcTools::extractToTime(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "missing or invalid 'to' argument", - returnValue); - return; - } - - Ptr::Ref plf = PlayLogFactory::getInstance(); - Ptr::Ref playLog = plf->getPlayLog(); - - Ptr::Ref> >::Ref playLogVector - = playLog->getPlayLogEntries(fromTime, toTime); - - XmlRpcTools::playLogVectorToXmlRpcValue(playLogVector, returnValue); -} diff --git a/src/products/scheduler/src/GeneratePlayReportMethod.h b/src/products/scheduler/src/GeneratePlayReportMethod.h deleted file mode 100644 index 8ea014c36..000000000 --- a/src/products/scheduler/src/GeneratePlayReportMethod.h +++ /dev/null @@ -1,162 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GeneratePlayReportMethod_h -#define GeneratePlayReportMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/PlayLogEntry.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to return the list of audio clips which were - * played during a specified time interval. - * - * The name of the method when called through XML-RPC is "generatePlayReport". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • from - datetime - the start of the interval to give the playlog - * from, inclusive.
  • - *
  • to - datetime - the end of the interval to give the playlog - * to, non-inclusive.
  • - *
- * - * The XML-RPC function returns an XML-RPC array, containing a structure - * for each play log item in the interval. An array of size 0 means there - * are no play log entries. Each structure is as follows: - *
    - *
  • audioClipId - string - the id of the audio clip played
  • - *
  • timestamp - datetime - the time the clip was played (started)
  • - *
- * - * The audioClipId parameter is a string containing the hexadecimal value of - * the audio clip ID. - * It is up to 8 characters long, representing a value between 0 and 2^31-1, - * inclusive. - * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 1501 - invalid argument format
  • - *
  • 1502 - missing or invalid 'from' argument
  • - *
  • 1503 - missing or invalid 'to' argument
  • - *
  • 1520 - missing session ID argument
  • - *
- * - */ -class GeneratePlayReportMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - GeneratePlayReportMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - GeneratePlayReportMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the generatePlayReport command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // GeneratePlayReportMethod_h - diff --git a/src/products/scheduler/src/GeneratePlayReportMethodTest.cxx b/src/products/scheduler/src/GeneratePlayReportMethodTest.cxx deleted file mode 100644 index 4f8cdde48..000000000 --- a/src/products/scheduler/src/GeneratePlayReportMethodTest.cxx +++ /dev/null @@ -1,391 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" - -#include "SchedulerDaemon.h" -#include "PlayLogFactory.h" -#include "UploadPlaylistMethod.h" -#include "GeneratePlayReportMethod.h" -#include "GeneratePlayReportMethodTest.h" - -using namespace std; - -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(GeneratePlayReportMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -GeneratePlayReportMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = scheduler->getStorage(); - storage->reset(); - - playLog = scheduler->getPlayLog(); - insertEntries(); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } - - authentication = scheduler->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -GeneratePlayReportMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -GeneratePlayReportMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new GeneratePlayReportMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - - // set up a structure for the parameters - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 101; // 2001 - time.tm_mon = 10; // November - time.tm_mday = 12; - time.tm_hour = 18; - time.tm_min = 31; - time.tm_sec = 1; - parameters["from"] = &time; - time.tm_year = 101; // 2001 - time.tm_mon = 10; // November - time.tm_mday = 12; - time.tm_hour = 19; - time.tm_min = 31; - time.tm_sec = 1; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.size() == 0); -} - - -/*------------------------------------------------------------------------------ - * Insert some entries into the play log - *----------------------------------------------------------------------------*/ -void -GeneratePlayReportMethodTest :: insertEntries(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref audioClipId(new UniqueId(10001)); - Ptr::Ref timestamp(new ptime(time_from_string( - "2004-10-26 14:00:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - audioClipId.reset(new UniqueId(10017)); - timestamp.reset(new ptime(time_from_string("2004-10-26 15:30:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - audioClipId.reset(new UniqueId(10003)); - timestamp.reset(new ptime(time_from_string("2004-10-27 10:01:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); -} - - -/*------------------------------------------------------------------------------ - * Look at some intervals and check against test data - *----------------------------------------------------------------------------*/ -void -GeneratePlayReportMethodTest :: intervalTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new GeneratePlayReportMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - - // check for the interval 2004-10-26 between 13 and 15 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 13; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 15; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 1); - CPPUNIT_ASSERT(result[0].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[0]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - UniqueId newAudioClipId = UniqueId(std::string(result[0]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10001); - - CPPUNIT_ASSERT(result[0].hasMember("timestamp")); - CPPUNIT_ASSERT(result[0]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[0]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 26); - CPPUNIT_ASSERT(time.tm_hour == 14); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - - - // check for the interval 2004-10-26 between 14 o'clock and 15:30 - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 14; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 15; - time.tm_min = 30; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 1); - CPPUNIT_ASSERT(result[0].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[0]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - newAudioClipId = UniqueId(std::string(result[0]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10001); - - CPPUNIT_ASSERT(result[0].hasMember("timestamp")); - CPPUNIT_ASSERT(result[0]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[0]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 26); - CPPUNIT_ASSERT(time.tm_hour == 14); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - - - // check for the interval 2004-10-26 15:00 to 2012-08-01 midnight - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 15; - time.tm_min = 30; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 112; // 2012 - time.tm_mon = 7; // August - time.tm_mday = 1; - time.tm_hour = 0; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 2); - CPPUNIT_ASSERT(result[0].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[0]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - newAudioClipId = UniqueId(std::string(result[0]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10017); - - CPPUNIT_ASSERT(result[0].hasMember("timestamp")); - CPPUNIT_ASSERT(result[0]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[0]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 26); - CPPUNIT_ASSERT(time.tm_hour == 15); - CPPUNIT_ASSERT(time.tm_min == 30); - CPPUNIT_ASSERT(time.tm_sec == 0); - - CPPUNIT_ASSERT(result[1].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[1]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - newAudioClipId = UniqueId(std::string(result[1]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10003); - - CPPUNIT_ASSERT(result[1].hasMember("timestamp")); - CPPUNIT_ASSERT(result[1]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[1]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 27); - CPPUNIT_ASSERT(time.tm_hour == 10); - CPPUNIT_ASSERT(time.tm_min == 01); - CPPUNIT_ASSERT(time.tm_sec == 0); - - - // check for the interval 2004-10-26 16 o'clock to 2004-10-27 10 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 16; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 27; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // check the returned values - CPPUNIT_ASSERT(result.size() == 0); -} - - diff --git a/src/products/scheduler/src/GeneratePlayReportMethodTest.h b/src/products/scheduler/src/GeneratePlayReportMethodTest.h deleted file mode 100644 index 2c7906224..000000000 --- a/src/products/scheduler/src/GeneratePlayReportMethodTest.h +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GeneratePlayReportMethodTest_h -#define GeneratePlayReportMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the GeneratePlayReportMethod class. - * - * @see GeneratePlayReportMethod - */ -class GeneratePlayReportMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(GeneratePlayReportMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(intervalTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The play log used during the test. - */ - Ptr::Ref playLog; - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Insert some entries into the play log to provide test data. - */ - void - insertEntries(void) throw (CPPUNIT_NS::Exception); - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Look at some intervals, and check them against the test data. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - intervalTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // GeneratePlayReportMethodTest_h - diff --git a/src/products/scheduler/src/GetSchedulerTimeMethod.cxx b/src/products/scheduler/src/GetSchedulerTimeMethod.cxx deleted file mode 100644 index f2bcb2345..000000000 --- a/src/products/scheduler/src/GetSchedulerTimeMethod.cxx +++ /dev/null @@ -1,102 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include -#include - -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "GetSchedulerTimeMethod.h" - - -using namespace boost::posix_time; -using namespace boost::gregorian; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string GetSchedulerTimeMethod::methodName - = "getSchedulerTime"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int GetSchedulerTimeMethod::errorId = 1900; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -GetSchedulerTimeMethod :: GetSchedulerTimeMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the stop XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -GetSchedulerTimeMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - Ptr::Ref schedulerPTime = TimeConversion::now(); - struct tm schedulerTime; - TimeConversion::ptimeToTm(schedulerPTime, schedulerTime); - returnValue["schedulerTime"] = & schedulerTime; -} - diff --git a/src/products/scheduler/src/GetSchedulerTimeMethod.h b/src/products/scheduler/src/GetSchedulerTimeMethod.h deleted file mode 100644 index 9591318f2..000000000 --- a/src/products/scheduler/src/GetSchedulerTimeMethod.h +++ /dev/null @@ -1,139 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GetSchedulerTimeMethod_h -#define GetSchedulerTimeMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to report the local time on the computer where - * the scheduler daemon is running. - * - * The name of the method when called through XML-RPC is - * "getSchedulerTime". - * - * No input parameters are expected. - * - * The XML-RPC function returns an XML-RPC structure containing a single - * ISO 8601 DateTime field: - *
    - *
  • schedulerTime - datetime - the local time on the scheduler
  • - *
- * - * This method does not generate any fault responses. - * - */ -class GetSchedulerTimeMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - GetSchedulerTimeMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - GetSchedulerTimeMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the getSchedulerTime command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // GetSchedulerTimeMethod_h - diff --git a/src/products/scheduler/src/GetSchedulerTimeMethodTest.cxx b/src/products/scheduler/src/GetSchedulerTimeMethodTest.cxx deleted file mode 100644 index ebbb10f7a..000000000 --- a/src/products/scheduler/src/GetSchedulerTimeMethodTest.cxx +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include -#include - -#include "SchedulerDaemon.h" -#include "GetSchedulerTimeMethodTest.h" - -using namespace std; -using namespace XmlRpc; -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(GetSchedulerTimeMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -GetSchedulerTimeMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -GetSchedulerTimeMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ -} - - -/*------------------------------------------------------------------------------ - * Test a simple query, resulting in an empty result set. - *----------------------------------------------------------------------------*/ -void -GetSchedulerTimeMethodTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref - getSchedulerTimeMethod(new GetSchedulerTimeMethod()); - -// XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; -// rootParameter[0] = parameters; - XmlRpcValue result; - struct tm time1, - time2; - result.clear(); - try { - getSchedulerTimeMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("schedulerTime")); - time1 = result["schedulerTime"]; - - result.clear(); - try { - getSchedulerTimeMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("schedulerTime")); - time2 = result["schedulerTime"]; - - CPPUNIT_ASSERT(time1.tm_year == time2.tm_year); - // could fail on New Year's Eve, but we don't work on New Year's Eve - - CPPUNIT_ASSERT(time1.tm_hour <= time2.tm_hour); - CPPUNIT_ASSERT(time1.tm_min <= time2.tm_min); - CPPUNIT_ASSERT(time1.tm_min + 1 >= time2.tm_min); -} - diff --git a/src/products/scheduler/src/GetSchedulerTimeMethodTest.h b/src/products/scheduler/src/GetSchedulerTimeMethodTest.h deleted file mode 100644 index a00d3a00d..000000000 --- a/src/products/scheduler/src/GetSchedulerTimeMethodTest.h +++ /dev/null @@ -1,101 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GetSchedulerTimeMethodTest_h -#define GetSchedulerTimeMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the getSchedulerTime XML-RPC call. - * - * @see SchedulerDaemon - */ -class GetSchedulerTimeMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(GetSchedulerTimeMethodTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * Simple test for an empty query. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // GetSchedulerTimeMethodTest_h - diff --git a/src/products/scheduler/src/GetVersionMethod.cxx b/src/products/scheduler/src/GetVersionMethod.cxx deleted file mode 100644 index 465b22459..000000000 --- a/src/products/scheduler/src/GetVersionMethod.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "GetVersionMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string GetVersionMethod::methodName = "getVersion"; - - -/*------------------------------------------------------------------------------ - * The version string. - *----------------------------------------------------------------------------*/ -const std::string GetVersionMethod::versionStr = - "LiveSupport Scheduler Daemon " - PACKAGE_VERSION " " - "(" __DATE__ ")"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -GetVersionMethod :: GetVersionMethod ( - Ptr::Ref xmlRpcServer) throw () - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the stop XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -GetVersionMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - returnValue["version"] = versionStr; -} - diff --git a/src/products/scheduler/src/GetVersionMethod.h b/src/products/scheduler/src/GetVersionMethod.h deleted file mode 100644 index 66bd2fd35..000000000 --- a/src/products/scheduler/src/GetVersionMethod.h +++ /dev/null @@ -1,133 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GetVersionMethod_h -#define GetVersionMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to return the version string for the - * scheduler daemon. - * - * The name of the method when called through XML-RPC is "getVersion". - * - * There are no expected parameters for this method. - * - * The XML-RPC function returns an XML-RPC structure, containing the following - * fields: - *
    - *
  • version - string - the version string of the Scheduler Daemon
  • - *
- * - * There are no possible internal error condititons for this function. - * - */ -class GetVersionMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The version string, returned by this method. - */ - static const std::string versionStr; - - - public: - /** - * A default constructor, for testing purposes. - */ - GetVersionMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - GetVersionMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the create playlist command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // GetVersionMethod_h - diff --git a/src/products/scheduler/src/GetVersionMethodTest.cxx b/src/products/scheduler/src/GetVersionMethodTest.cxx deleted file mode 100644 index aa38b4554..000000000 --- a/src/products/scheduler/src/GetVersionMethodTest.cxx +++ /dev/null @@ -1,107 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "GetVersionMethod.h" -#include "GetVersionMethodTest.h" - -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(GetVersionMethodTest); - -/** - * The prefix of the persumed version string. - */ -static const std::string versionPrefix = "LiveSupport Scheduler Daemon"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -GetVersionMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -GetVersionMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -GetVersionMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new GetVersionMethod()); - XmlRpc::XmlRpcValue rootParameter; - XmlRpc::XmlRpcValue result; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("version")); - std::string versionStr = result["version"]; - CPPUNIT_ASSERT(versionStr.find(versionPrefix) == 0); -} - diff --git a/src/products/scheduler/src/GetVersionMethodTest.h b/src/products/scheduler/src/GetVersionMethodTest.h deleted file mode 100644 index 207a5f063..000000000 --- a/src/products/scheduler/src/GetVersionMethodTest.h +++ /dev/null @@ -1,105 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef GetVersionMethodTest_h -#define GetVersionMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the GetVersionMethod class. - * - * @see GetVersionMethod - */ -class GetVersionMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(GetVersionMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // GetVersionMethodTest_h - diff --git a/src/products/scheduler/src/LoginMethod.cxx b/src/products/scheduler/src/LoginMethod.cxx deleted file mode 100644 index 7c31a0859..000000000 --- a/src/products/scheduler/src/LoginMethod.cxx +++ /dev/null @@ -1,119 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "LoginMethod.h" - - -using namespace LiveSupport::Authentication; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string LoginMethod::methodName = "login"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int LoginMethod::errorId = 2000; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -LoginMethod :: LoginMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the XML-RPC function call. - * (Overrides 'execute' in XmlRpcServerMethod.) - *----------------------------------------------------------------------------*/ -void -LoginMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref loginName; - try{ - loginName = XmlRpcTools::extractLoginName(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing login argument", - returnValue); - return; - } - - Ptr::Ref password; - try{ - password = XmlRpcTools::extractPassword(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "missing password argument", - returnValue); - return; - } - - Ptr::Ref - acf = AuthenticationClientFactory::getInstance(); - Ptr::Ref - authentication = acf->getAuthenticationClient(); - - Ptr::Ref sessionId; - try { - sessionId = authentication->login(*loginName, *password); - } catch (Core::XmlRpcException &e) { - std::string eMsg = "authentication login() returned error:\n"; - eMsg += e.what(); - XmlRpcTools::markError(errorId+4, eMsg, returnValue); - return; - } - - XmlRpcTools::sessionIdToXmlRpcValue(sessionId, returnValue); -} - diff --git a/src/products/scheduler/src/LoginMethod.h b/src/products/scheduler/src/LoginMethod.h deleted file mode 100644 index 7291c9ba4..000000000 --- a/src/products/scheduler/src/LoginMethod.h +++ /dev/null @@ -1,142 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LoginMethod_h -#define LoginMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to log in using the authentication server. - * - * The name of the method when called through XML-RPC is "login". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • login - string - the login name
  • - *
  • password - string - the password.
  • - *
- * - * The XML-RPC function returns an XML-RPC structure, containing the following - * fields: - *
    - *
  • sessionId - string - a new session ID.
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 2001 - invalid argument format
  • - *
  • 2002 - missing login argument
  • - *
  • 2003 - missing password argument
  • - *
  • 2004 - the authentication server reported an error
  • - *
- * - */ -class LoginMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - LoginMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - LoginMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the login command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // LoginMethod_h - diff --git a/src/products/scheduler/src/LogoutMethod.cxx b/src/products/scheduler/src/LogoutMethod.cxx deleted file mode 100644 index e88b67c5b..000000000 --- a/src/products/scheduler/src/LogoutMethod.cxx +++ /dev/null @@ -1,107 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "LogoutMethod.h" - - -using namespace LiveSupport::Authentication; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string LogoutMethod::methodName = "logout"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int LogoutMethod::errorId = 2100; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -LogoutMethod :: LogoutMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the XML-RPC function call. - * (Overrides 'execute' in XmlRpcServerMethod.) - *----------------------------------------------------------------------------*/ -void -LogoutMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, "missing logout argument", - returnValue); - return; - } - - Ptr::Ref - acf = AuthenticationClientFactory::getInstance(); - Ptr::Ref - authentication = acf->getAuthenticationClient(); - - try { - authentication->logout(sessionId); - } catch (Core::XmlRpcException &e) { - std::string eMsg = "authentication logout() returned error:\n"; - eMsg += e.what(); - XmlRpcTools::markError(errorId+4, eMsg, returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/LogoutMethod.h b/src/products/scheduler/src/LogoutMethod.h deleted file mode 100644 index d93325cd9..000000000 --- a/src/products/scheduler/src/LogoutMethod.h +++ /dev/null @@ -1,134 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef LogoutMethod_h -#define LogoutMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to log out from the authentication server. - * - * The name of the method when called through XML-RPC is "logout". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID returned by login.
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 2101 - invalid argument format
  • - *
  • 2120 - missing session ID argument
  • - *
  • 2104 - the authentication server reported an error
  • - *
- * - */ -class LogoutMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - LogoutMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - LogoutMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the logout command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // LogoutMethod_h - diff --git a/src/products/scheduler/src/PlayLogFactory.cxx b/src/products/scheduler/src/PlayLogFactory.cxx deleted file mode 100644 index 78a63cdc4..000000000 --- a/src/products/scheduler/src/PlayLogFactory.cxx +++ /dev/null @@ -1,110 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "PostgresqlPlayLog.h" -#include "PlayLogFactory.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string PlayLogFactory::configElementNameStr = - "playLogFactory"; - -/*------------------------------------------------------------------------------ - * The singleton instance of PlayLogFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref PlayLogFactory::singleton; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance to PlayLogFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref -PlayLogFactory :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new PlayLogFactory()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the play log factory. - *----------------------------------------------------------------------------*/ -void -PlayLogFactory :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - playLog.reset(); - - Ptr::Ref cmf = - ConnectionManagerFactory::getInstance(); - Ptr::Ref cm = cmf->getConnectionManager(); - - // try to look for a PostgresqlPlayLog configuration element - xmlpp::Node::NodeList nodes = - element.get_children(PostgresqlPlayLog::getConfigElementName()); - if (nodes.size() >= 1) { - const xmlpp::Element * configElement = - dynamic_cast (*(nodes.begin())); - Ptr::Ref dbs(new PostgresqlPlayLog(cm)); - dbs->configure(*configElement); - playLog = dbs; - } - - if (!playLog) { - throw std::invalid_argument("no play log factories to configure"); - } -} - diff --git a/src/products/scheduler/src/PlayLogFactory.h b/src/products/scheduler/src/PlayLogFactory.h deleted file mode 100644 index 1c2cf8b6b..000000000 --- a/src/products/scheduler/src/PlayLogFactory.h +++ /dev/null @@ -1,176 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlayLogFactory_h -#define PlayLogFactory_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Configurable.h" -#include "PlayLogInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The factory to create appropriate PlayLog objects. - * - * This object has to be configured with an element that contains - * the configuration element that the factory should build. - * Currently only PostgresqlPlayLog is supported by this factory. - * - * An example configuration element is the following: - * - *

- *      <playLogFactory>
- *          <postgresqlPlayLog/>
- *      </playLogFactory>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT playLogFactory (postgresqlPlayLog) >
- *  
- * - * For details on the <postgreslPlayLog> element, see the - * PostgresqlPlayLog documentation. - * - * @see PostgresqlPlayLog - */ -class PlayLogFactory : virtual public Configurable -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The play log created by this factory. - */ - Ptr::Ref playLog; - - /** - * The default constructor. - */ - PlayLogFactory(void) throw() - { - } - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PlayLogFactory(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuration information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Return a play log. - * - * @return the appropriate play log, according to the - * configuration of this factory. - */ - Ptr::Ref - getPlayLog(void) throw () - { - return playLog; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PlayLogFactory_h - diff --git a/src/products/scheduler/src/PlayLogInterface.h b/src/products/scheduler/src/PlayLogInterface.h deleted file mode 100644 index 0ef99c787..000000000 --- a/src/products/scheduler/src/PlayLogInterface.h +++ /dev/null @@ -1,117 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlayLogInterface_h -#define PlayLogInterface_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Playlist.h" -#include "LiveSupport/Core/PlayLogEntry.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The generic interface for the component scheduling events. - * - */ -class PlayLogInterface -{ - public: - /** - * Add a new entry to the play log. - * - * @param audioClipId the audio clip played. - * @param timeStamp the time the clip was played (started). - * @return the id of the newly created play log entry. - */ - virtual Ptr::Ref - addPlayLogEntry(Ptr::Ref audioClipId, - Ptr::Ref timeStamp) - throw (std::invalid_argument) - = 0; - - /** - * Return the list of play log entries for a specified time interval. - * - * @param fromTime the start of the time of the interval queried, - * inclusive - * @param toTime to end of the time of the interval queried, - * non-inclusive - * @return a vector of the play log entries for the time region. - */ - virtual Ptr::Ref> >::Ref - getPlayLogEntries(Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (std::invalid_argument) - = 0; - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PlayLogInterface(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PlayLogInterface_h - diff --git a/src/products/scheduler/src/PlaylistEvent.cxx b/src/products/scheduler/src/PlaylistEvent.cxx deleted file mode 100644 index b31c00399..000000000 --- a/src/products/scheduler/src/PlaylistEvent.cxx +++ /dev/null @@ -1,182 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_UNISTD_H -#include -#else -#error need unistd.h -#endif - -#include - -#define DEBUG_PREFIX "Scheduler" -#include "LiveSupport/Core/Debug.h" - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Core/SessionId.h" - -#include "PlaylistEvent.h" - -using namespace boost; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -PlaylistEvent :: PlaylistEvent( - Ptr::Ref sessionId, - Ptr::Ref audioPlayer, - Ptr::Ref storage, - Ptr::Ref playLog, - Ptr::Ref scheduleEntry) - throw () -{ - this->sessionId = sessionId; - this->audioPlayer = audioPlayer; - this->storage = storage; - this->playLog = playLog; - this->scheduleEntry = scheduleEntry; - - // this init time is a wild guess, say 10 seconds should be enough - initTime.reset(new posix_time::time_duration(0, 0, 10, 0)); - - state = created; -} - - -/*------------------------------------------------------------------------------ - * Initialize the event object. - *----------------------------------------------------------------------------*/ -void -PlaylistEvent :: initialize(void) throw (std::exception) -{ - //DEBUG_BLOCK - - if (state != created) { - throw std::logic_error("PlaylistEvent in bad state"); - } - - state = initializing; - // some ugliness because getPlaylistId() returns a const pointer - Ptr::Ref playlistId(new UniqueId(scheduleEntry->getPlaylistId() - ->getId())); - try { - playlist = storage->acquirePlaylist(sessionId, playlistId); - } catch (Core::XmlRpcException &e) { - std::string errorMessage = "storage server error: "; - errorMessage += e.what(); - throw std::logic_error(errorMessage); - } - - audioPlayer->preload(*playlist->getUri()); - state = initialized; -} - - -/*------------------------------------------------------------------------------ - * De-initialize the event object. - *----------------------------------------------------------------------------*/ -void -PlaylistEvent :: deInitialize(void) throw () -{ - DEBUG_BLOCK - - try { - storage->releasePlaylist(playlist); - } catch (XmlRpcException &e) { - std::cerr << e.what() << std::endl; - // TODO: handle error? - } - playlist.reset(); - state = deInitialized; -} - - -/*------------------------------------------------------------------------------ - * Initialize the event object. - *----------------------------------------------------------------------------*/ -void -PlaylistEvent :: start(Ptr::Ref offset) throw () -{ - DEBUG_BLOCK - - if (state != initialized) { - initialize(); - } - - try { - audioPlayer->open(*playlist->getUri(), (gint64)playlist->getId()->getId(), offset->total_nanoseconds()); - audioPlayer->start(); - - playLog->addPlayLogEntry(playlist->getId(), TimeConversion::now()); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - // TODO: handle error? - } catch (std::runtime_error &e) { - std::cerr << e.what() << std::endl; - // TODO: handle error? - } - state = running; -} - - -/*------------------------------------------------------------------------------ - * Initialize the event object. - *----------------------------------------------------------------------------*/ -void -PlaylistEvent :: stop(void) throw () -{ - DEBUG_BLOCK - - try { - audioPlayer->stop(); - audioPlayer->close(); - } catch (std::logic_error &e) { - // TODO: handle error - // NOTE: this may not be an error, because the user may have stopped - // the playback manually (see Scheduler::StopCurrentlyPlayingMethod) - std::cerr << "PlaylistEvent::stop error: " << std::endl; - std::cerr << e.what() << std::endl; - } - state = stopped; -} - diff --git a/src/products/scheduler/src/PlaylistEvent.h b/src/products/scheduler/src/PlaylistEvent.h deleted file mode 100644 index fcb7f8820..000000000 --- a/src/products/scheduler/src/PlaylistEvent.h +++ /dev/null @@ -1,240 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlaylistEvent_h -#define PlaylistEvent_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Core/ScheduleEntry.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "LiveSupport/EventScheduler/ScheduledEventInterface.h" - -#include "PlayLogInterface.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::EventScheduler; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::StorageClient; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A scheduled event for playing a playlist. - * - */ -class PlaylistEvent : public virtual ScheduledEventInterface -{ - private: - /** - * Enumeration describing the possible states of the event. - */ - typedef enum { created, - initializing, - initialized, - running, - stopped, - deInitialized } State; - - private: - /** - * The audio player to play the playlist with. - */ - Ptr::Ref audioPlayer; - - /** - * The play log facility. - */ - Ptr::Ref playLog; - - /** - * The storage containing the playlist and all related audio clips. - */ - Ptr::Ref storage; - - /** - * The schedule entry this event is playing. - */ - Ptr::Ref scheduleEntry; - - /** - * The maximum time this event should get initialized in. - */ - Ptr::Ref initTime; - - /** - * The Playlist this event is playing. - */ - Ptr::Ref playlist; - - /** - * The session ID used for authentication at the storage server. - */ - Ptr::Ref sessionId; - - /** - * The current state of the event. - */ - State state; - - - public: - /** - * Constructor. - * - * @param sessionId the session id used to access the storage. - * @param audioPlayer the audio player to play the playlist with. - * @param storage the storage containing the playlist to play, - * and all the related audio clips. - * @param playLog the play log facility. - * @param scheduleEntry the schedule entry this event is - * playing. - */ - PlaylistEvent(Ptr::Ref sessionId, - Ptr::Ref audioPlayer, - Ptr::Ref storage, - Ptr::Ref playLog, - Ptr::Ref scheduleEntry) - throw (); - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PlaylistEvent(void) throw () - { - } - - /** - * Tell the time this event is scheduled for. - * - * @return the time this event is scheduled for. - */ - virtual Ptr::Ref - getScheduledTime(void) throw () - { - return scheduleEntry->getStartTime(); - } - - /** - * Initialize the event object. - * This should finishin at most maxTimeToInitialize() time. - * Use this call to allocate any resources that will be needed - * by the event itself. - * - * @exception std::exception on initialization problems. - * a raised exception will result in the cancellation - * of the event. - * @see #maxTimeToInitialize - */ - virtual void - initialize(void) throw (std::exception); - - /** - * The maximum time for the initalize() function to complete. - * It is the responsibility of the ScheduledEventInterface object to - * complete the initialization in that time. - * - * @return the maximum time for the initialize() function to complete. - * @see #initialize - */ - virtual Ptr::Ref - maxTimeToInitialize(void) throw () - { - return initTime; - } - - /** - * De-initialize the event object. - */ - virtual void - deInitialize(void) throw (); - - /** - * Start the event. - * This function call should start the execution of the event in - * a separate thread, and return immediately. - */ - virtual void - start(Ptr::Ref offset) throw (); - - /** - * The length of the event. - * The scheduler will call stop() when this much time has passed - * after calling start(). - * - * @return the length of the event, in time. - */ - virtual Ptr::Ref - eventLength(void) throw () - { - return scheduleEntry->getPlaylength(); - } - - /** - * Stop the event. - * This function call should result in the event stopping, if - * this has not happened yet. The processing of this event should - * persue in a seperate thread, and the function itself should - * return immediately. - */ - virtual void - stop(void) throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - - -#endif // PlaylistEvent_h - diff --git a/src/products/scheduler/src/PlaylistEventContainer.cxx b/src/products/scheduler/src/PlaylistEventContainer.cxx deleted file mode 100644 index a299b4551..000000000 --- a/src/products/scheduler/src/PlaylistEventContainer.cxx +++ /dev/null @@ -1,114 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_UNISTD_H -#include -#else -#error need unistd.h -#endif - - -#include "PlaylistEventContainer.h" -#include "PlaylistEvent.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::EventScheduler; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Constructor. - *----------------------------------------------------------------------------*/ -PlaylistEventContainer :: PlaylistEventContainer( - Ptr::Ref sessionId, - Ptr::Ref storage, - Ptr::Ref schedule, - Ptr::Ref audioPlayer, - Ptr::Ref playLog) - throw () -{ - this->sessionId = sessionId; - this->storage = storage; - this->schedule = schedule; - this->audioPlayer = audioPlayer; - this->playLog = playLog; -} - - -/*------------------------------------------------------------------------------ - * Return the first scheduled event after the specified timepoint - *----------------------------------------------------------------------------*/ -Ptr::Ref -PlaylistEventContainer :: getNextEvent(Ptr::Ref when) throw () -{ - Ptr::Ref entry = schedule->getNextEntry(when); - Ptr::Ref event; - - if (entry.get()) { - event.reset(new PlaylistEvent(sessionId, - audioPlayer, - storage, - playLog, - entry)); - } - - return event; -} - -/*------------------------------------------------------------------------------ - * Return the first scheduled event after the specified timepoint - *----------------------------------------------------------------------------*/ -Ptr::Ref -PlaylistEventContainer :: getCurrentEvent() throw () -{ - Ptr::Ref entry = schedule->getCurrentEntry(); - Ptr::Ref event; - - if (entry.get()) { - event.reset(new PlaylistEvent(sessionId, - audioPlayer, - storage, - playLog, - entry)); - } - - return event; -} - diff --git a/src/products/scheduler/src/PlaylistEventContainer.h b/src/products/scheduler/src/PlaylistEventContainer.h deleted file mode 100644 index 70624389b..000000000 --- a/src/products/scheduler/src/PlaylistEventContainer.h +++ /dev/null @@ -1,162 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlaylistEventContainer_h -#define PlaylistEventContainer_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "LiveSupport/EventScheduler/EventContainerInterface.h" - -#include "PlayLogInterface.h" -#include "ScheduleInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::EventScheduler; -using namespace LiveSupport::StorageClient; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An event container holding the scheduled playlists. - * - */ -class PlaylistEventContainer : public virtual EventContainerInterface -{ - private: - /** - * The session id, passed on to PlaylistEvents, to access - * resources from the storage. - */ - Ptr::Ref sessionId; - - /** - * The storage containing the playlists to play. - */ - Ptr::Ref storage; - - /** - * The schedule interface to get the events from. - */ - Ptr::Ref schedule; - - /** - * The audio player to play the playlist with. - */ - Ptr::Ref audioPlayer; - - /** - * The play log facility. - */ - Ptr::Ref playLog; - - - public: - /** - * Constructor. - * - * @param sessionId the session id that will be accepted by - * calls to storage - * @param storage the storage containing the playlist and related - * audio clips - * @param schedule the schedule to get the events from. - * @param audioPlayer the audio player to play the playlists with. - * @param playLog the play log facility. - */ - PlaylistEventContainer(Ptr::Ref sessionId, - Ptr::Ref storage, - Ptr::Ref schedule, - Ptr::Ref audioPlayer, - Ptr::Ref playLog) - throw (); - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PlaylistEventContainer(void) throw () - { - } - - /** - * Return the first event after the specified timepoint. - * - * @param when return the first event after this timepoint, - * @return the first event to schedule after the specified - * timepoint. may be a reference to 0, if currently - * there are no known events after the specified time. - */ - virtual Ptr::Ref - getNextEvent(Ptr::Ref when) throw (); - - - /** - * Return current event - * - * @param - * @return the first event to schedule at this point in time - * may be a reference to 0, if there are no known events at this time - */ - virtual Ptr::Ref - getCurrentEvent() throw (); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - - -#endif // PlaylistEventContainer_h - diff --git a/src/products/scheduler/src/PlaylistEventContainerTest.cxx b/src/products/scheduler/src/PlaylistEventContainerTest.cxx deleted file mode 100644 index e5be1dfb9..000000000 --- a/src/products/scheduler/src/PlaylistEventContainerTest.cxx +++ /dev/null @@ -1,184 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "PlayLogFactory.h" - -#include "SchedulerDaemon.h" -#include "PlaylistEventContainer.h" -#include "PlaylistEventContainerTest.h" - - -using namespace boost::posix_time; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(PlaylistEventContainerTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -PlaylistEventContainerTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - audioPlayer = scheduler->getAudioPlayer(); - storage = scheduler->getStorage(); - storage->reset(); - schedule = scheduler->getSchedule(); - authentication = scheduler->getAuthentication(); - playLog = scheduler->getPlayLog(); - - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - audioPlayer->initialize(); - - if (!(sessionId = authentication->login("root", "q"))) { - CPPUNIT_FAIL("could not log in to authentication server"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -PlaylistEventContainerTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - audioPlayer->deInitialize(); - - playLog.reset(); - schedule.reset(); - storage.reset(); - audioPlayer.reset(); - - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * A simple smoke test. - *----------------------------------------------------------------------------*/ -void -PlaylistEventContainerTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref container; - container.reset(new PlaylistEventContainer(sessionId, - storage, - schedule, - audioPlayer, - playLog)); - - // see that there are no events scheduled - Ptr::Ref scheduledEvent; - scheduledEvent = container->getNextEvent(TimeConversion::now()); - CPPUNIT_ASSERT(!scheduledEvent.get()); -} - - -/*------------------------------------------------------------------------------ - * Schedule something, and see if we can get it back. - *----------------------------------------------------------------------------*/ -void -PlaylistEventContainerTest :: scheduleTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref container; - container.reset(new PlaylistEventContainer(sessionId, - storage, - schedule, - audioPlayer, - playLog)); - - // schedule playlist 1 at 10 seconds from now - Ptr::Ref playlistId(new UniqueId(1)); - Ptr::Ref playlist = storage->getPlaylist(sessionId, - playlistId); - CPPUNIT_ASSERT(playlist.get()); - Ptr::Ref now = TimeConversion::now(); - Ptr::Ref from(new ptime(*now + seconds(10))); - - try { - schedule->schedulePlaylist(playlist, from); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } - - Ptr::Ref scheduledEvent; - - // see if we can get back the scheduled playlist - scheduledEvent = container->getNextEvent(now); - CPPUNIT_ASSERT(scheduledEvent.get()); - CPPUNIT_ASSERT(*scheduledEvent->eventLength() - == *playlist->getPlaylength()); - - // see that there are no events scheduled after from - scheduledEvent = container->getNextEvent(from); - CPPUNIT_ASSERT(!scheduledEvent.get()); -} - diff --git a/src/products/scheduler/src/PlaylistEventContainerTest.h b/src/products/scheduler/src/PlaylistEventContainerTest.h deleted file mode 100644 index 3eb266698..000000000 --- a/src/products/scheduler/src/PlaylistEventContainerTest.h +++ /dev/null @@ -1,159 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlaylistEventContainerTest_h -#define PlaylistEventContainerTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "ScheduleInterface.h" -#include "PlayLogInterface.h" -#include "ScheduleFactory.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::StorageClient; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the PlaylistEventContainer class - * - * @see PlaylistEventContainer - */ -class PlaylistEventContainerTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(PlaylistEventContainerTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(scheduleTest); - CPPUNIT_TEST_SUITE_END(); - - private: - /** - * The audio player used by the test. - */ - Ptr::Ref audioPlayer; - - /** - * The storage used by the container. - */ - Ptr::Ref storage; - - /** - * The schedule used by the container. - */ - Ptr::Ref schedule; - - /** - * An authentication client. - */ - Ptr::Ref authentication; - - /** - * A playlog interface. - */ - Ptr::Ref playLog; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - - protected: - - /** - * Simple smoke test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test to see if we can get back a scheduled event. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - scheduleTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PlaylistEventContainerTest_h - diff --git a/src/products/scheduler/src/PlaylistEventTest.cxx b/src/products/scheduler/src/PlaylistEventTest.cxx deleted file mode 100644 index 82b58bea8..000000000 --- a/src/products/scheduler/src/PlaylistEventTest.cxx +++ /dev/null @@ -1,202 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h" - -#include "SchedulerDaemon.h" -#include "PlayLogFactory.h" -#include "PlaylistEvent.h" -#include "PlaylistEventTest.h" - - -using namespace boost::posix_time; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::PlaylistExecutor; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(PlaylistEventTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -PlaylistEventTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - audioPlayer = scheduler->getAudioPlayer(); - storage = scheduler->getStorage(); - storage->reset(); - authentication = scheduler->getAuthentication(); - playLog = scheduler->getPlayLog(); - - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - - audioPlayer->initialize(); - - duration.reset(new time_duration(seconds(30))); - - if (!(sessionId = authentication->login("root", "q"))) { - CPPUNIT_FAIL("could not log in to authentication server"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -PlaylistEventTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - audioPlayer->deInitialize(); - - duration.reset(); - storage.reset(); - audioPlayer.reset(); - playLog.reset(); - - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Create a sample playlist event - *----------------------------------------------------------------------------*/ -Ptr::Ref -PlaylistEventTest :: createTestEvent(void) throw (CPPUNIT_NS::Exception) -{ - // create a fake schedule entry, with id 1 for playlist 1, starting - // 10 seconds from now, and lasting 30 seconds - Ptr::Ref entryId(new UniqueId(1)); - Ptr::Ref playlistId(new UniqueId(1)); - Ptr::Ref now = TimeConversion::now(); - Ptr::Ref startTime(new ptime(*now + seconds(10))); - Ptr::Ref endTime(new ptime(*startTime + *duration)); - Ptr::Ref scheduleEntry(new ScheduleEntry(entryId, - playlistId, - startTime, - endTime)); - - Ptr::Ref playlistEvent(new PlaylistEvent(sessionId, - audioPlayer, - storage, - playLog, - scheduleEntry)); - - return playlistEvent; -} - - -/*------------------------------------------------------------------------------ - * A simple smoke test. - *----------------------------------------------------------------------------*/ -void -PlaylistEventTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref playlistEvent = createTestEvent(); - - CPPUNIT_ASSERT(*playlistEvent->eventLength() == seconds(30)); -} - - -/*------------------------------------------------------------------------------ - * See if the playlist event can be initialized. - *----------------------------------------------------------------------------*/ -void -PlaylistEventTest :: initializeTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref playlistEvent = createTestEvent(); - - try { - playlistEvent->initialize(); - playlistEvent->deInitialize(); - } catch (std::logic_error &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * See if the playlist can be played - *----------------------------------------------------------------------------*/ -void -PlaylistEventTest :: playTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref playlistEvent = createTestEvent(); - - try { - playlistEvent->initialize(); - playlistEvent->start(); - TimeConversion::sleep(duration); - playlistEvent->stop(); - playlistEvent->deInitialize(); - } catch (std::logic_error &e) { - CPPUNIT_FAIL(e.what()); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } -} - diff --git a/src/products/scheduler/src/PlaylistEventTest.h b/src/products/scheduler/src/PlaylistEventTest.h deleted file mode 100644 index aa4e329d7..000000000 --- a/src/products/scheduler/src/PlaylistEventTest.h +++ /dev/null @@ -1,168 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PlaylistEventTest_h -#define PlaylistEventTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "PlayLogInterface.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::PlaylistExecutor; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the PlaylistEvent class - * - * @see PlaylistEvent - */ -class PlaylistEventTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(PlaylistEventTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(initializeTest); - CPPUNIT_TEST(playTest); - CPPUNIT_TEST_SUITE_END(); - - private: - /** - * The audio player used by the test. - */ - Ptr::Ref audioPlayer; - - /** - * The storage used by the interface. - */ - Ptr::Ref storage; - - /** - * The duration of the testing events. - */ - Ptr::Ref duration; - - /** - * An authentication client. - */ - Ptr::Ref authentication; - - /** - * A playlog interface. - */ - Ptr::Ref playLog; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Create a playlist event for testing purposes. - */ - Ptr::Ref - createTestEvent(void) throw (CPPUNIT_NS::Exception); - - - protected: - - /** - * Simple smoke test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to see if the playlist event can be initialized. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - initializeTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to see if the playlist event can be played. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - playTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PlaylistEventTest_h - diff --git a/src/products/scheduler/src/PostgresqlBackup.cxx b/src/products/scheduler/src/PostgresqlBackup.cxx deleted file mode 100644 index b9875f3e7..000000000 --- a/src/products/scheduler/src/PostgresqlBackup.cxx +++ /dev/null @@ -1,429 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Core/FileTools.h" -#include "LiveSupport/Core/XmlRpcInvalidArgumentException.h" -#include "LiveSupport/Core/XmlRpcMethodFaultException.h" -#include "LiveSupport/Core/XmlRpcIOException.h" -#include "LiveSupport/Db/Conversion.h" -#include "PostgresqlBackup.h" - -using namespace odbc; -using namespace boost::posix_time; -using namespace xmlpp; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string PostgresqlBackup::configElementNameStr - = "postgresqlBackup"; - -namespace { - -/*------------------------------------------------------------------------------ - * The name of the schedule export element - *----------------------------------------------------------------------------*/ -const std::string scheduleExportElementName = "scheduleExport"; - - -/*------------------------------------------------------------------------------ - * The name of the fromTime attribute - *----------------------------------------------------------------------------*/ -const std::string fromTimeAttrName = "fromTime"; - -/*------------------------------------------------------------------------------ - * The name of the toTime attribute - *----------------------------------------------------------------------------*/ -const std::string toTimeAttrName = "toTime"; - - -/*------------------------------------------------------------------------------ - * The working backup state - *----------------------------------------------------------------------------*/ -const std::string workingState = "working"; - -/*------------------------------------------------------------------------------ - * The finished / success backup state - *----------------------------------------------------------------------------*/ -const std::string successState = "success"; - -/*------------------------------------------------------------------------------ - * The finished / failure backup state - *----------------------------------------------------------------------------*/ -const std::string failureState = "fault"; - - -/*------------------------------------------------------------------------------ - * The name of the schedule export fie in the export tarbal; - *----------------------------------------------------------------------------*/ -const std::string scheduleExportFileName = "meta-inf/scheduler.xml"; - - -/*------------------------------------------------------------------------------ - * A statement to check if the database can be accessed. - *----------------------------------------------------------------------------*/ -const std::string check1Stmt = "SELECT 1"; - -/*------------------------------------------------------------------------------ - * A statement to check if the backup table exists. - *----------------------------------------------------------------------------*/ -const std::string backupCountStmt = "SELECT COUNT(*) FROM backup"; - -/*------------------------------------------------------------------------------ - * A statement to store a backup entry. - * - token - the token of the backup - * - status - the status of the backup, either 'working', 'success' or 'fault' - * - fromTime - the start time of the schedule backup - * - toTime - the end time of the schedule backup - *----------------------------------------------------------------------------*/ -const std::string storeBackupStmt = - "INSERT INTO backup(token, sessionId, status, fromTime, toTime) " - "VALUES(?, ?, ?, ?, ?)"; - -/*------------------------------------------------------------------------------ - * Get a backup from the database. - * - token - the token of an existing backup - *----------------------------------------------------------------------------*/ -const std::string getBackupStmt = - "SELECT token, sessionId, status, fromTime, toTime FROM backup " - "WHERE token = ?"; - -/*------------------------------------------------------------------------------ - * A statement to update a backup entry. - * - status - the new status of the backup - * - token - the token of an existing backup - *----------------------------------------------------------------------------*/ -const std::string updateBackupStmt = - "UPDATE backup SET status = ? WHERE token = ?"; - -/*------------------------------------------------------------------------------ - * A statement to delete a backup entry - * - token - the token of an existing backup - *----------------------------------------------------------------------------*/ -const std::string deleteBackupStmt = "DELETE FROM backup WHERE token = ?"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the backup. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackup :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - // nothing to do here, really -} - - -/*------------------------------------------------------------------------------ - * Start a backup process. - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlBackup ::createBackupOpen(Ptr::Ref sessionId, - Ptr::Ref criteria, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (XmlRpcException) -{ - Ptr::Ref token; - Ptr::Ref conn; - bool result = false; - - // open up a backup process with the storage server - token = storage->createBackupOpen(sessionId, criteria); - - // store the details of the backup, with a pending status - try { - conn = connectionManager->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - storeBackupStmt)); - pstmt->setString(1, *token); - pstmt->setString(2, sessionId->getId()); - pstmt->setString(3, asyncStateToString(AsyncState::pendingState)); - - timestamp = Conversion::ptimeToTimestamp(fromTime); - pstmt->setTimestamp(4, *timestamp); - - timestamp = Conversion::ptimeToTimestamp(toTime); - pstmt->setTimestamp(5, *timestamp); - - result = pstmt->executeUpdate() == 1; - - connectionManager->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - connectionManager->returnConnection(conn); - } - throw XmlRpcMethodFaultException(e.what()); - } - - if (!result) { - throw XmlRpcMethodFaultException("couldn't insert into database"); - } - - return token; -} - - -/*------------------------------------------------------------------------------ - * Check on the status of a backup process. - *----------------------------------------------------------------------------*/ -AsyncState -PostgresqlBackup ::createBackupCheck( - const Glib::ustring & token, - Ptr::Ref & url, - Ptr::Ref & path, - Ptr::Ref & errorMessage) - throw (XmlRpcException) -{ - Ptr::Ref conn; - AsyncState status; - Ptr::Ref fromTime; - Ptr::Ref toTime; - bool result; - - // first, check on the status ourselves - try { - Ptr::Ref timestamp; - - conn = connectionManager->getConnection(); - Ptr::Ref pstmt(conn->prepareStatement( - getBackupStmt)); - - pstmt->setString(1, token); - - Ptr::Ref rs(pstmt->executeQuery()); - if (rs->next()) { - status = stringToAsyncState(rs->getString(3)); - - timestamp.reset(new Timestamp(rs->getTimestamp(4))); - fromTime = Conversion::timestampToPtime(timestamp); - - timestamp.reset(new Timestamp(rs->getTimestamp(5))); - toTime = Conversion::timestampToPtime(timestamp); - } - - connectionManager->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - connectionManager->returnConnection(conn); - } - // TODO: report error - return status; - } - - if (status == AsyncState::pendingState) { - status = storage->createBackupCheck(token, url, path, errorMessage); - - if (status == AsyncState::finishedState) { - putScheduleExportIntoTar(path, fromTime, toTime); - } - } - - // update the status - try { - conn = connectionManager->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - updateBackupStmt)); - pstmt->setString(1, asyncStateToString(status)); - pstmt->setString(2, token); - - result = pstmt->executeUpdate() == 1; - - connectionManager->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - connectionManager->returnConnection(conn); - } - throw XmlRpcMethodFaultException(e.what()); - } - - if (!result) { - throw XmlRpcMethodFaultException("couldn't insert into database"); - } - - return status; -} - - -/*------------------------------------------------------------------------------ - * Close a backup process, and free up all resources. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackup ::putScheduleExportIntoTar( - Ptr::Ref & path, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (std::runtime_error) -{ - Ptr::Ref document(new Document()); - Element * root = document->create_root_node("scheduler"); - std::string tmpFileName = FileTools::tempnam(); - - // create the export, and write it to a temporary file - schedule->exportScheduleEntries(root, fromTime, toTime); - document->write_to_file(tmpFileName); - - try { - FileTools::appendFileToTarball(*path, - tmpFileName, - scheduleExportFileName); - } catch (std::runtime_error &e) { - remove(tmpFileName.c_str()); - throw; - } - - remove(tmpFileName.c_str()); -} - - -/*------------------------------------------------------------------------------ - * Close a backup process, and free up all resources. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackup ::createBackupClose(const Glib::ustring & token) - throw (XmlRpcException) -{ - Ptr::Ref conn; - bool result; - - storage->createBackupClose(token); - - // delete the backup from our database - try { - conn = connectionManager->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - deleteBackupStmt)); - pstmt->setString(1, token); - - result = pstmt->executeUpdate() == 1; - - connectionManager->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - connectionManager->returnConnection(conn); - } - throw XmlRpcInvalidArgumentException(e.what()); - } - - if (!result) { - throw XmlRpcMethodFaultException("couldn't insert into database"); - } -} - - -/*------------------------------------------------------------------------------ - * Convert a string status to an AsyncState. - *----------------------------------------------------------------------------*/ -AsyncState -PostgresqlBackup ::stringToAsyncState(const std::string & statusString) - throw () -{ - return AsyncState::fromBackupString(statusString); -} - - -/*------------------------------------------------------------------------------ - * Convert an AsyncState to a string. - *----------------------------------------------------------------------------*/ -std::string -PostgresqlBackup ::asyncStateToString(AsyncState status) - throw () -{ - return *status.toBackupString(); -} - - -/*------------------------------------------------------------------------------ - * Restore a schedule backup. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackup :: restoreBackup(Ptr::Ref sessionId, - Ptr::Ref path) - throw (XmlRpcException) -{ - //TODO: check the session ID - - std::string tmpFileName = FileTools::tempnam(); - try { - FileTools::extractFileFromTarball(*path, - scheduleExportFileName, - tmpFileName); - } catch (std::runtime_error &e) { - remove(tmpFileName.c_str()); - std::string errorMsg = "error opening the schedule backup file:\n"; - errorMsg += e.what(); - throw XmlRpcIOException(errorMsg); - } - - Ptr::Ref parser(new DomParser(tmpFileName, - false /* do not expect a DTD */)); - const Document * document = parser->get_document(); - const Element * xmlSchedule = document->get_root_node(); - const Node::NodeList children = xmlSchedule->get_children( - "scheduleExport"); - const Element * xmlScheduleExport - = (const Element *) children.front(); - try { - schedule->importScheduleEntries(xmlScheduleExport); - } catch (std::invalid_argument &e) { - std::string errorMsg = "error restoring the schedule backup:\n"; - errorMsg += e.what(); - throw XmlRpcMethodFaultException(errorMsg); - } -} - diff --git a/src/products/scheduler/src/PostgresqlBackup.h b/src/products/scheduler/src/PostgresqlBackup.h deleted file mode 100644 index 93e91cda1..000000000 --- a/src/products/scheduler/src/PostgresqlBackup.h +++ /dev/null @@ -1,306 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PostgresqlBackup_h -#define PostgresqlBackup_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Db/ConnectionManagerInterface.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "ScheduleInterface.h" -#include "BackupInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An object for creating and restoring combined schedule and storage backups. - * - * This an implementation of the BackupInterface type. It stores the token - * used for the createBackupXxxx() functions in a PostgreSQL database. - * - * This object has to be configured with a simple empty element, as - * the following: - * - *

- *      <postgresqlBackup/>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT postgresqlBackup EMPTY >
- *  
- * - */ -class PostgresqlBackup : public Configurable, - public BackupInterface -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The database connection manager to use for connecting to the - * database. - */ - Ptr::Ref connectionManager; - - /** - * The storage client to use for connecting to the storage server. - */ - Ptr::Ref storage; - - /** - * The schedule to use for reading the schedule entries from. - */ - Ptr::Ref schedule; - - /** - * The default constructor. - */ - PostgresqlBackup(void) throw() - { - } - - /** - * Insert a schedule export XML file into an existing tarball. - * - * @param path the file path to the existing tarball. - * @param fromTime the time to generate the XML export from - * @param toTime the time to generate the XML export to - * @throws std::runtime_error on file / tarball handling issues. - */ - void - putScheduleExportIntoTar( - Ptr::Ref & path, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (std::runtime_error); - - /** - * Convert a string status to an AsyncState. - * It converts - *
    - *
  • "working" -> pendingState
  • - *
  • "success" -> finishedState
  • - *
  • "fault" -> failedState
  • - *
  • anything else -> invalidState
  • - *
- */ - AsyncState - stringToAsyncState(const std::string & statusString) throw (); - - /** - * Convert an AsyncState to a string. - * It converts - *
    - *
  • initState or pendingState -> "working"
  • - *
  • finishedState -> "success"
  • - *
  • failedState -> "fault"
  • - *
  • anything else -> "invalid"
  • - *
- */ - std::string - asyncStateToString(AsyncState status) - throw (); - - - public: - /** - * Construct a PostgresqlBackup. - * - * @param cm the connection manager the PostgresqlBackup will use to - * connect to the database. - */ - PostgresqlBackup( - Ptr::Ref connectionManager, - Ptr::Ref storage, - Ptr::Ref schedule) - throw () - : connectionManager(connectionManager), - storage(storage), - schedule(schedule) - { - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PostgresqlBackup(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Configure the object based on the XML element supplied. - * The supplied element is expected to be of the name - * returned by configElementName(). - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Start to create a backup by calling the storage, and also - * adding a backup of the schedule. - * To check if the backup procedure is still pending, call - * createBackupCheck() regularly. - * Make sure to close the backup by calling createBackupClose(). - * - * @param sessionId a valid session ID to use for accessing the - * storage - * @param criteria the criteria to use for backing up the storage - * @param fromTime entries are included in the schedule export starting - * from this time. - * @param toTime entries as included in the schedule export - * up to but not including this time. - * @return a token, which can be used to query the backup process. - * @exception XmlRpcException on XML-RPC issues. - * @see #createBackupCheck - * @see #createBackupClose - */ - virtual Ptr::Ref - createBackupOpen(Ptr::Ref sessionId, - Ptr::Ref criteria, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (XmlRpcException); - - /** - * Check the status of a storage backup. - * - * @param token the identifier of this backup task. - * @param url return parameter; - * if the status is "success", it contains the - * URL of the created backup file. - * @param path return parameter; - * if the status is "success", it contains the - * local access path of the created backup file. - * @param errorMessage return parameter; - * if the status is "fault", it contains the - * fault string. - * @return the state of the backup process: one of pendingState, - * finishedState, or failedState. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - * @see #createBackupOpen - * @see #createBackupClose - */ - virtual AsyncState - createBackupCheck(const Glib::ustring & token, - Ptr::Ref & url, - Ptr::Ref & path, - Ptr::Ref & errorMessage) - throw (XmlRpcException); - - /** - * Close the storage backup process. - * Frees up all resources allocated to the backup. - * - * @param token the identifier of this backup task. - * @exception XmlRpcException if there is a problem with the XML-RPC - * call. - * @see #createBackupOpen - * @see #createBackupCheck - */ - virtual void - createBackupClose(const Glib::ustring & token) - throw (XmlRpcException); - - /** - * Restore a schedule backup. - * - * All playlist IDs contained in the backup should already be in the - * storage. If this is a combined backup, with both storage and - * schedule components, then restore this backup to the storage - * first, and then call this function. - * - * @param sessionId a valid session ID to identify the user. - * @param path the location of the archive to upload. - * @exception XmlRpcException if there is an error. - */ - virtual void - restoreBackup(Ptr::Ref sessionId, - Ptr::Ref path) - throw (XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PostgresqlBackup_h - diff --git a/src/products/scheduler/src/PostgresqlBackupTest.cxx b/src/products/scheduler/src/PostgresqlBackupTest.cxx deleted file mode 100644 index 00d69e640..000000000 --- a/src/products/scheduler/src/PostgresqlBackupTest.cxx +++ /dev/null @@ -1,231 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include - -#include "LiveSupport/Core/FileTools.h" -#include "SchedulerDaemon.h" -#include "PostgresqlBackup.h" -#include "PostgresqlBackupTest.h" - - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(PostgresqlBackupTest); - -namespace { - -/** - * The location of the temporary backup file - */ -const std::string tempBackupTarFileName = "tmp/scheduleBackup.tar"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -PostgresqlBackupTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - try { - Ptr::Ref connectionManager; - Ptr::Ref storage; - Ptr::Ref schedule; - - connectionManager = daemon->getConnectionManager(); - storage = daemon->getStorage(); - schedule = daemon->getSchedule(); - - backup.reset(new PostgresqlBackup(connectionManager, - storage, - schedule)); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } - - authentication = daemon->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -PostgresqlBackupTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT_NO_THROW( - authentication->logout(sessionId); - ); - - remove(tempBackupTarFileName.c_str()); -} - - -/*------------------------------------------------------------------------------ - * Create the backup. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackupTest :: createBackup(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref criteria(new SearchCriteria); - criteria->setLimit(10); - Ptr::Ref from(new ptime(time_from_string("2004-07-23 10:00:00"))); - Ptr::Ref to(new ptime(time_from_string("2004-07-23 11:00:00"))); - - Ptr::Ref token; - CPPUNIT_ASSERT_NO_THROW( - token = backup->createBackupOpen(sessionId, criteria, from, to); - ); - CPPUNIT_ASSERT(token); - - Ptr::Ref url; - Ptr::Ref path; - Ptr::Ref errorMessage; - AsyncState status; - int iterations = 20; - do { - std::cerr << "-/|\\"[iterations%4] << '\b'; - sleep(1); - CPPUNIT_ASSERT_NO_THROW( - status = backup->createBackupCheck(*token, url, path, errorMessage); - ); - CPPUNIT_ASSERT(status == AsyncState::pendingState - || status == AsyncState::finishedState - || status == AsyncState::failedState); - } while (--iterations && status == AsyncState::pendingState); - - CPPUNIT_ASSERT_EQUAL(AsyncState::finishedState, status); - CPPUNIT_ASSERT(url); - CPPUNIT_ASSERT(path); - - // copy the backup file - CPPUNIT_ASSERT_NO_THROW( - remove(tempBackupTarFileName.c_str()); - std::ifstream ifs(path->c_str(), std::ios::binary); - std::ofstream ofs(tempBackupTarFileName.c_str(), std::ios::binary); - ofs << ifs.rdbuf(); - ); - - CPPUNIT_ASSERT_NO_THROW( - backup->createBackupClose(*token); - ); -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can create backups. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackupTest :: createBackupTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT_NO_THROW( - createBackup() - ); - - bool exists; - std::string schedulerBackupInTarball = "meta-inf/scheduler.xml"; - CPPUNIT_ASSERT_NO_THROW( - exists = FileTools::existsInTarball(tempBackupTarFileName, - schedulerBackupInTarball) - ); - CPPUNIT_ASSERT(exists); - - std::string extractedTempFileName = "tmp/scheduler.tmp.xml"; - FILE * file; - - remove(extractedTempFileName.c_str()); - file = fopen(extractedTempFileName.c_str(), "r"); - CPPUNIT_ASSERT(file == 0); - - CPPUNIT_ASSERT_NO_THROW( - FileTools::extractFileFromTarball(tempBackupTarFileName, - schedulerBackupInTarball, - extractedTempFileName) - ); - - file = fopen(extractedTempFileName.c_str(), "r"); - CPPUNIT_ASSERT(file != 0); - CPPUNIT_ASSERT(fclose(file) == 0); - - CPPUNIT_ASSERT(remove(extractedTempFileName.c_str()) == 0); - file = fopen(extractedTempFileName.c_str(), "r"); - CPPUNIT_ASSERT(file == 0); -} - - -/*------------------------------------------------------------------------------ - * Test to see if we can restore backups. - *----------------------------------------------------------------------------*/ -void -PostgresqlBackupTest :: restoreBackupTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT_NO_THROW( - createBackup() - ); - - Ptr::Ref backupFile(new const Glib::ustring( - tempBackupTarFileName)); - CPPUNIT_ASSERT_NO_THROW( - backup->restoreBackup(sessionId, backupFile) - ); - // TODO: try this with a non-empty backup file, too -} - diff --git a/src/products/scheduler/src/PostgresqlBackupTest.h b/src/products/scheduler/src/PostgresqlBackupTest.h deleted file mode 100644 index acaa06f4b..000000000 --- a/src/products/scheduler/src/PostgresqlBackupTest.h +++ /dev/null @@ -1,136 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PostgresqlBackupTest_h -#define PostgresqlBackupTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "PostgresqlBackup.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the PostgresqlBackup class. - * - * @see PostgresqlBackup - */ -class PostgresqlBackupTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(PostgresqlBackupTest); - CPPUNIT_TEST(createBackupTest); - CPPUNIT_TEST(restoreBackupTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The PostgresqlBackup object which does the backup operations. - */ - Ptr::Ref backup; - - /** - * The authentication client used to log in. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Auxiliary method: create the backup file. Used by both tests. - */ - void - createBackup(void) throw (CPPUNIT_NS::Exception); - - - protected: - - /** - * Test to see if the backup works as expected - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - createBackupTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test to see if the backup works as expected - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - restoreBackupTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PostgresqlBackupTest_h - diff --git a/src/products/scheduler/src/PostgresqlPlayLog.cxx b/src/products/scheduler/src/PostgresqlPlayLog.cxx deleted file mode 100644 index a9883205a..000000000 --- a/src/products/scheduler/src/PostgresqlPlayLog.cxx +++ /dev/null @@ -1,201 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Db/Conversion.h" -#include "PostgresqlPlayLog.h" - -using namespace odbc; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string PostgresqlPlayLog::configElementNameStr = - "postgresqlPlayLog"; - -/*------------------------------------------------------------------------------ - * A statement to check if the database can be accessed. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlPlayLog::check1Stmt = "SELECT 1"; - -/*------------------------------------------------------------------------------ - * A statement to check if the log table exists. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlPlayLog::logCountStmt = - "SELECT COUNT(*) FROM playLog"; - -/*------------------------------------------------------------------------------ - * The SQL statement for adding a play log entry. - * It's a simple insert. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlPlayLog::addPlayLogEntryStmt = - "INSERT INTO playLog(id, audioClipId, timeStamp) VALUES(?, ?, ?)"; - -/*------------------------------------------------------------------------------ - * The SQL statement for querying scheduled entries for a time interval - * The parameters for this call are: from, to - * and returns the properties: audioClipId, timeStamp for all - * play log entries between from and to, ordered by timeStamp. - * TODO: the below query only lists entries starting inside [from:to[ - * but what about entries starting before, but flowing into [from:to[ ? - *----------------------------------------------------------------------------*/ -const std::string PostgresqlPlayLog::getPlayLogEntriesStmt = - "SELECT id, audioClipId, timeStamp FROM playLog WHERE " - "(? <= timeStamp) AND (timeStamp < ?) " - "ORDER BY timeStamp"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the schedule. - *----------------------------------------------------------------------------*/ -void -PostgresqlPlayLog :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - // nothing to do here, really -} - - -/*------------------------------------------------------------------------------ - * Add a new play log entry - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlPlayLog :: addPlayLogEntry( - Ptr::Ref audioClipId, - Ptr::Ref clipTimestamp) - throw (std::invalid_argument) -{ - Ptr::Ref conn; - bool result = false; - Ptr::Ref id; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - addPlayLogEntryStmt)); - id = UniqueId::generateId(); - pstmt->setLong(1, id->getId()); - - pstmt->setLong(2, audioClipId->getId()); - - timestamp = Conversion::ptimeToTimestamp(clipTimestamp); - pstmt->setTimestamp(3, *timestamp); - - result = (pstmt->executeUpdate() == 1); - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument(e.what()); - } - - if (!result) { - throw std::invalid_argument("couldn't insert into database"); - } - - return id; -} - - -/*------------------------------------------------------------------------------ - * Get the play log entries for a given time interval - *----------------------------------------------------------------------------*/ -Ptr::Ref> >::Ref -PostgresqlPlayLog :: getPlayLogEntries( - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (std::invalid_argument) -{ - Ptr::Ref conn; - Ptr::Ref> >::Ref result( - new std::vector::Ref>()); - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - getPlayLogEntriesStmt)); - timestamp = Conversion::ptimeToTimestamp(fromTime); - pstmt->setTimestamp(1, *timestamp); - timestamp = Conversion::ptimeToTimestamp(toTime); - pstmt->setTimestamp(2, *timestamp); - - Ptr::Ref rs(pstmt->executeQuery()); - while (rs->next()) { - Ptr::Ref id(new UniqueId(rs->getLong(1))); - Ptr::Ref audioClipId(new UniqueId(rs->getLong(2))); - - *timestamp = rs->getTimestamp(3); - Ptr::Ref clipTimestamp - = Conversion::timestampToPtime(timestamp); - - Ptr::Ref entry(new PlayLogEntry(id, - audioClipId, - clipTimestamp)); - result->push_back(entry); - } - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument("couldn't get play log entries"); - } - - return result; -} - diff --git a/src/products/scheduler/src/PostgresqlPlayLog.h b/src/products/scheduler/src/PostgresqlPlayLog.h deleted file mode 100644 index 5805ae018..000000000 --- a/src/products/scheduler/src/PostgresqlPlayLog.h +++ /dev/null @@ -1,208 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PostgresqlPlayLog_h -#define PostgresqlPlayLog_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Db/ConnectionManagerInterface.h" -#include "PlayLogInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An object containing a log of the clips played in a PostreSQL database. - * - * This object has to be configured with a simple empty element, as - * the following: - * - *

- *      <postgresqlPlayLog/>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT postgresqlPlayLog EMPTY >
- *  
- * - */ -class PostgresqlPlayLog : public Configurable, - public PlayLogInterface -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * A SQL statement to check if the database can be accessed. - */ - static const std::string check1Stmt; - - /** - * A SQL statement to check if the log table exists. - */ - static const std::string logCountStmt; - - /** - * The SQL statement for adding a play log entry. - */ - static const std::string addPlayLogEntryStmt; - - /** - * The SQL statement for getting the play log for a time interval - */ - static const std::string getPlayLogEntriesStmt; - - /** - * The database connection manager to use for connecting the - * database. - */ - Ptr::Ref cm; - - /** - * The default constructor. - */ - PostgresqlPlayLog(void) throw() - { - } - - - public: - /** - * Construct a PostgresqlPlayLog. - * - * @param cm the connection manager the PostgresqlPlayLog will use to - * connect to the database. - */ - PostgresqlPlayLog(Ptr::Ref cm) - throw () - { - this->cm = cm; - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PostgresqlPlayLog(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Configure the object based on the XML element supplied. - * The supplied element is expected to be of the name - * returned by configElementName(). - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Add a new entry to the play log. - * - * @param audioClipId the audio clip played. - * @param timeStamp the time the clip was played (started). - * @return the id of the newly created play log entry. - */ - virtual Ptr::Ref - addPlayLogEntry(Ptr::Ref audioClipId, - Ptr::Ref timeStamp) - throw (std::invalid_argument); - - /** - * Return the list of play log entries for a specified time interval. - * - * @param fromTime the start of the time of the interval queried, - * inclusive - * @param toTime to end of the time of the interval queried, - * non-inclusive - * @return a vector of the play log entries for the time region. - */ - virtual Ptr::Ref> >::Ref - getPlayLogEntries(Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (std::invalid_argument); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PostgresqlPlayLog_h - diff --git a/src/products/scheduler/src/PostgresqlPlayLogTest.cxx b/src/products/scheduler/src/PostgresqlPlayLogTest.cxx deleted file mode 100644 index 66939701d..000000000 --- a/src/products/scheduler/src/PostgresqlPlayLogTest.cxx +++ /dev/null @@ -1,179 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "SchedulerDaemon.h" -#include "PostgresqlPlayLog.h" -#include "PostgresqlPlayLogTest.h" - - -using namespace boost::posix_time; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(PostgresqlPlayLogTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -PostgresqlPlayLogTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - cm = scheduler->getConnectionManager(); - - playLog.reset(new PostgresqlPlayLog(cm)); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -PostgresqlPlayLogTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - playLog.reset(); - cm.reset(); -} - - -/*------------------------------------------------------------------------------ - * Add a single item to the play log. - *----------------------------------------------------------------------------*/ -void -PostgresqlPlayLogTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref audioClipId = UniqueId::generateId(); - Ptr::Ref timestamp(new ptime(time_from_string( - "2004-10-25 16:09:00"))); - - try { - playLog->addPlayLogEntry(audioClipId, timestamp); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * See if getPlayLogEntries() returns correct lists - *----------------------------------------------------------------------------*/ -void -PostgresqlPlayLogTest :: getPlayLogEntriesTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref audioClipId; - Ptr::Ref timestamp; - Ptr::Ref fromTime; - Ptr::Ref toTime; - - Ptr::Ref> >::Ref entries; - Ptr::Ref entry; - - try { - audioClipId.reset(new UniqueId(10001)); - timestamp.reset(new ptime(time_from_string("2004-10-25 10:00:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - audioClipId.reset(new UniqueId(10002)); - timestamp.reset(new ptime(time_from_string("2004-10-25 10:12:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - audioClipId.reset(new UniqueId(10003)); - timestamp.reset(new ptime(time_from_string("2004-10-25 12:00:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - // first interval - fromTime.reset(new ptime(time_from_string("2004-10-25 10:00:00"))); - toTime.reset( new ptime(time_from_string("2004-10-25 12:00:00"))); - entries = playLog->getPlayLogEntries(fromTime, toTime); - - CPPUNIT_ASSERT(entries->size() == 2); - entry = (*entries)[0]; - CPPUNIT_ASSERT(entry->getAudioClipId()->getId() == 10001); - timestamp.reset(new ptime(time_from_string("2004-10-25 10:00:00"))); - CPPUNIT_ASSERT(*(entry->getTimestamp()) == *timestamp); - entry = (*entries)[1]; - CPPUNIT_ASSERT(entry->getAudioClipId()->getId() == 10002); - timestamp.reset(new ptime(time_from_string("2004-10-25 10:12:00"))); - CPPUNIT_ASSERT(*(entry->getTimestamp()) == *timestamp); - - // second interval - fromTime.reset(new ptime(time_from_string("2004-10-25 10:10:00"))); - toTime.reset( new ptime(time_from_string("2005-10-25 00:00:00"))); - entries = playLog->getPlayLogEntries(fromTime, toTime); - - CPPUNIT_ASSERT(entries->size() == 2); - entry = (*entries)[0]; - CPPUNIT_ASSERT(entry->getAudioClipId()->getId() == 10002); - timestamp.reset(new ptime(time_from_string("2004-10-25 10:12:00"))); - CPPUNIT_ASSERT(*(entry->getTimestamp()) == *timestamp); - entry = (*entries)[1]; - CPPUNIT_ASSERT(entry->getAudioClipId()->getId() == 10003); - timestamp.reset(new ptime(time_from_string("2004-10-25 12:00:00"))); - CPPUNIT_ASSERT(*(entry->getTimestamp()) == *timestamp); - - // third interval -- this one's empty - fromTime.reset(new ptime(time_from_string("2004-10-25 13:00:00"))); - toTime.reset( new ptime(time_from_string("2005-10-25 13:00:00"))); - entries = playLog->getPlayLogEntries(fromTime, toTime); - - CPPUNIT_ASSERT(entries->size() == 0); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} diff --git a/src/products/scheduler/src/PostgresqlPlayLogTest.h b/src/products/scheduler/src/PostgresqlPlayLogTest.h deleted file mode 100644 index f24f38be8..000000000 --- a/src/products/scheduler/src/PostgresqlPlayLogTest.h +++ /dev/null @@ -1,128 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PostgresqlPlayLogTest_h -#define PostgresqlPlayLogTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Db/ConnectionManagerInterface.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Db; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the PostgresqlPlayLog class. - * - * @see PostgresqlPlayLog - */ -class PostgresqlPlayLogTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(PostgresqlPlayLogTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(getPlayLogEntriesTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The connection manager used for testing. - */ - Ptr::Ref cm; - - /** - * The schedule used for testing. - */ - Ptr::Ref playLog; - - - protected: - - /** - * Add a single play log entry. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Add a few play log entries, then query time intervals around them. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - getPlayLogEntriesTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PostgresqlScheduleTest_h - diff --git a/src/products/scheduler/src/PostgresqlSchedule.cxx b/src/products/scheduler/src/PostgresqlSchedule.cxx deleted file mode 100644 index a3c4084ea..000000000 --- a/src/products/scheduler/src/PostgresqlSchedule.cxx +++ /dev/null @@ -1,761 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Db/Conversion.h" -#include "PostgresqlSchedule.h" - -using namespace odbc; -using namespace boost::posix_time; - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::configElementNameStr = - "postgresqlSchedule"; - -/*------------------------------------------------------------------------------ - * The name of the schedule export element - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::scheduleExportElementName - = "scheduleExport"; - - -/*------------------------------------------------------------------------------ - * The name of the fromTime attribute - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::fromTimeAttrName = "fromTime"; - - -/*------------------------------------------------------------------------------ - * The name of the toTime attribute - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::toTimeAttrName = "toTime"; - - -/*------------------------------------------------------------------------------ - * A statement to check if the database can be accessed. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::check1Stmt = "SELECT 1"; - -/*------------------------------------------------------------------------------ - * A statement to check if the schedule table exists. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::scheduleCountStmt = - "SELECT COUNT(*) FROM schedule"; - -/*------------------------------------------------------------------------------ - * The SQL statement for querying if a timeframe is available. - * The parameters for this call are: starts, starts, ends, ends, starts, ends, - * and returns the number of items falling into the quieried timeframe. - * Basically checks if the starts or ends value falls within the queried frame - * or starts before and ends after the queried timeframe. - *----------------------------------------------------------------------------*/ -//const std::string PostgresqlSchedule::isTimeframaAvailableStmt = -// "SELECT COUNT(*) FROM schedule WHERE " -// "((starts <= ? AND ? < ends) OR (starts < ? AND ? <= ends)) " -// "OR (? <= starts AND ends <= ?)"; - -//new criteria is that playlists cannot start at the same time -const std::string PostgresqlSchedule::isTimeframaAvailableStmt = - "SELECT COUNT(*) FROM schedule WHERE " - "starts = ?"; - -/*------------------------------------------------------------------------------ - * The SQL statement for scheduling a playlist. - * It's a simple insert. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::schedulePlaylistStmt = - "INSERT INTO schedule(id, playlist, starts, ends) VALUES(?, ?, ?, ?)"; - -/*------------------------------------------------------------------------------ - * The SQL statement for getting a schedule entry based on its id - * The parameters for this call are: entryId - * and returns the properties: id, playlist, starts, ends for the entry - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::getScheduleEntryStmt = - "SELECT id, playlist, starts, ends FROM schedule WHERE id = ?"; - -/*------------------------------------------------------------------------------ - * The SQL statement for rescheduling a playlist (an UPDATE call). - * There parameters for this call are: new start, new end, id. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::reschedulePlaylistStmt = - "UPDATE schedule SET starts = ?, ends = ? WHERE id = ?"; - -/*------------------------------------------------------------------------------ - * The SQL statement for querying scheduled entries for a time interval - * The parameters for this call are: from, to - * and returns the properties: id, playlist, starts, ends for all - * schedule entries between from and to, ordered by starts. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::getScheduleEntriesStmt = - "SELECT id, playlist, starts, ends FROM schedule WHERE " - "(? < ends) AND (starts < ?) " - "ORDER BY starts"; - -/*------------------------------------------------------------------------------ - * The SQL statement for getting the currently playing schedule entry. - * The parameters for this call are: from - * and returns the properties: id, playlist, starts, ends for the next - * schedule entry after the specified timepoint - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::getCurrentlyPlayingStmt = - "SELECT id, playlist, starts, ends FROM schedule " - " WHERE starts <= ? AND ? < ends"; - -/*------------------------------------------------------------------------------ - * The SQL statement for querying the next scheduled entry from the - * specified timepoint. - * The parameters for this call are: from - * and returns the properties: id, playlist, starts, ends for the next - * schedule entry after the specified timepoint - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::getNextEntryStmt = - "SELECT id, playlist, starts, ends FROM schedule WHERE ? < starts " - "ORDER BY starts"; - -/*------------------------------------------------------------------------------ - * The SQL statement for querying current scheduled entry - * The parameters for this call are: from - * and returns the properties: id, playlist, starts, ends for the current - * schedule entry - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::getCurrentEntryStmt = - "SELECT id, playlist, starts, ends FROM schedule WHERE starts <= ? AND ? < ends " - "ORDER BY starts"; - -/*------------------------------------------------------------------------------ - * The SQL statement for querying if a schedule entry exists. - * Expects a single argument, the id of the schedule to check. - * Returns 1 if the entry exists, 0 otherwise. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::scheduleEntryExistsStmt = - "SELECT COUNT(*) FROM schedule WHERE id = ?"; - -/*------------------------------------------------------------------------------ - * The SQL statement for removing a schedule. - * Expects a single argument, the id of the schedule to remove. - *----------------------------------------------------------------------------*/ -const std::string PostgresqlSchedule::removeFromScheduleStmt = - "DELETE FROM schedule WHERE id = ?"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the schedule. - *----------------------------------------------------------------------------*/ -void -PostgresqlSchedule :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - // nothing to do here, really -} - - -/*------------------------------------------------------------------------------ - * Check if a timeframe is available. - *----------------------------------------------------------------------------*/ -bool -PostgresqlSchedule :: isTimeframeAvailable( - Ptr::Ref from, - Ptr::Ref to) throw () -{ - Ptr::Ref conn; - bool result = false; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - isTimeframaAvailableStmt)); - timestamp = Conversion::ptimeToTimestamp(from, Conversion::roundDown); - pstmt->setTimestamp(1, *timestamp); -// pstmt->setTimestamp(2, *timestamp); -// pstmt->setTimestamp(5, *timestamp); -// -// timestamp = Conversion::ptimeToTimestamp(to, Conversion::roundUp); -// pstmt->setTimestamp(3, *timestamp); -// pstmt->setTimestamp(4, *timestamp); -// pstmt->setTimestamp(6, *timestamp); - - Ptr::Ref rs(pstmt->executeQuery()); - result = (rs->next()) ? (rs->getLong(1) == 0) : false; - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - return false; - } - - return result; -} - - -/*------------------------------------------------------------------------------ - * Schedule a playlist - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlSchedule :: schedulePlaylist( - Ptr::Ref playlist, - Ptr::Ref playtime) - throw (std::invalid_argument) -{ - Ptr::Ref conn; - bool result = false; - Ptr::Ref id; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref ends; - Ptr::Ref pstmt(conn->prepareStatement( - schedulePlaylistStmt)); - id = UniqueId::generateId(); - pstmt->setLong(1, id->getId()); - pstmt->setLong(2, playlist->getId()->getId()); - - timestamp = Conversion::ptimeToTimestamp(playtime, - Conversion::roundNearest); - pstmt->setTimestamp(3, *timestamp); - - ends.reset(new ptime((*playtime) + *(playlist->getPlaylength()))); - timestamp = Conversion::ptimeToTimestamp(ends, - Conversion::roundUp); - pstmt->setTimestamp(4, *timestamp); - - result = pstmt->executeUpdate() == 1; - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument(e.what()); - } - - if (!result) { - throw std::invalid_argument("couldn't insert into database"); - } - - return id; -} - - -/*------------------------------------------------------------------------------ - * Insert a schedule entry into the database - *----------------------------------------------------------------------------*/ -void -PostgresqlSchedule :: storeScheduleEntry( - Ptr::Ref scheduleEntry) - throw (std::invalid_argument) -{ - Ptr::Ref conn; - bool result = false; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref ends; - Ptr::Ref pstmt(conn->prepareStatement( - schedulePlaylistStmt)); - - pstmt->setLong(1, scheduleEntry->getId()->getId()); - pstmt->setLong(2, scheduleEntry->getPlaylistId()->getId()); - - timestamp = Conversion::ptimeToTimestamp(scheduleEntry->getStartTime(), - Conversion::roundDown); - pstmt->setTimestamp(3, *timestamp); - - timestamp = Conversion::ptimeToTimestamp(scheduleEntry->getEndTime(), - Conversion::roundUp); - pstmt->setTimestamp(4, *timestamp); - - result = pstmt->executeUpdate() == 1; - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument(e.what()); - } - - if (!result) { - throw std::invalid_argument("couldn't insert into database"); - } -} - - -/*------------------------------------------------------------------------------ - * Get the scheduled entries for a given timepoint - *----------------------------------------------------------------------------*/ -Ptr::Ref> >::Ref -PostgresqlSchedule :: getScheduleEntries( - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw () -{ - Ptr::Ref conn; - Ptr::Ref> >::Ref result( - new std::vector::Ref>()); - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - getScheduleEntriesStmt)); - timestamp = Conversion::ptimeToTimestamp(fromTime, - Conversion::roundDown); - pstmt->setTimestamp(1, *timestamp); - timestamp = Conversion::ptimeToTimestamp(toTime, - Conversion::roundUp); - pstmt->setTimestamp(2, *timestamp); - - Ptr::Ref rs(pstmt->executeQuery()); - while (rs->next()) { - Ptr::Ref id(new UniqueId(rs->getLong(1))); - Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); - - *timestamp = rs->getTimestamp(3); - Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); - - *timestamp = rs->getTimestamp(4); - Ptr::Ref endTime = Conversion::timestampToPtime(timestamp); - - Ptr::Ref entry(new ScheduleEntry(id, - playlistId, - startTime, - endTime)); - result->push_back(entry); - } - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - // TODO: report error - return result; - } - - return result; -} - - -/*------------------------------------------------------------------------------ - * Export schedule entries to an XML file. - *----------------------------------------------------------------------------*/ -void -PostgresqlSchedule :: exportScheduleEntries( - xmlpp::Element * element, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw () -{ - xmlpp::Element * scheduleExport; - Ptr::Ref> >::Ref entries; - std::vector::Ref>::iterator it; - - scheduleExport = element->add_child(scheduleExportElementName); - scheduleExport->set_attribute(fromTimeAttrName, to_iso_string(*fromTime)); - scheduleExport->set_attribute(toTimeAttrName, to_iso_string(*toTime)); - - entries = getScheduleEntries(fromTime, toTime); - it = entries->begin(); - while (it != entries->end()) { - Ptr::Ref entry = *it; - - entry->toDom(scheduleExport); - - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Import schedule entries from an XML file. - *----------------------------------------------------------------------------*/ -void -PostgresqlSchedule :: importScheduleEntries(const xmlpp::Element * element) - throw (std::invalid_argument) -{ - if (element->get_name() != scheduleExportElementName) { - std::string eMsg = "bad configuration element "; - eMsg += element->get_name(); - throw std::invalid_argument(eMsg); - } - - xmlpp::Node::NodeList children = - element->get_children(ScheduleEntry::getElementName()); - xmlpp::Node::NodeList::iterator it = children.begin(); - while (it != children.end()) { - xmlpp::Element * node = dynamic_cast (*it); - Ptr::Ref scheduleEntry; - - scheduleEntry.reset(new ScheduleEntry(node)); - storeScheduleEntry(scheduleEntry); - - ++it; - } -} - - -/*------------------------------------------------------------------------------ - * Get the currently playing entry - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlSchedule :: getCurrentlyPlaying(void) throw () -{ - Ptr::Ref conn; - Ptr::Ref result; - Ptr::Ref now = TimeConversion::now(); - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - getCurrentlyPlayingStmt)); - timestamp = Conversion::ptimeToTimestamp(now, Conversion::roundNearest); - pstmt->setTimestamp(1, *timestamp); - pstmt->setTimestamp(2, *timestamp); - - Ptr::Ref rs(pstmt->executeQuery()); - if (rs->next()) { - Ptr::Ref id(new UniqueId(rs->getLong(1))); - Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); - - *timestamp = rs->getTimestamp(3); - Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); - - *timestamp = rs->getTimestamp(4); - Ptr::Ref endTime = Conversion::timestampToPtime(timestamp); - - result.reset(new ScheduleEntry(id, playlistId, startTime, endTime)); - } - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - // TODO: report error - return result; - } - - return result; -} - - -/*------------------------------------------------------------------------------ - * Get the next schedule entry after a specified timepoint - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlSchedule :: getNextEntry(Ptr::Ref fromTime) - throw () -{ - Ptr::Ref conn; - Ptr::Ref result; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - getNextEntryStmt)); - timestamp = Conversion::ptimeToTimestamp(fromTime, - Conversion::roundDown); - pstmt->setTimestamp(1, *timestamp); - - Ptr::Ref rs(pstmt->executeQuery()); - if (rs->next()) { - Ptr::Ref id(new UniqueId(rs->getLong(1))); - Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); - - *timestamp = rs->getTimestamp(3); - Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); - - *timestamp = rs->getTimestamp(4); - Ptr::Ref endTime = Conversion::timestampToPtime(timestamp); - - result.reset(new ScheduleEntry(id, playlistId, startTime, endTime)); - } - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - // TODO: report error - return result; - } - - return result; -} - - -/*------------------------------------------------------------------------------ - * Get current schedule entry - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlSchedule :: getCurrentEntry() - throw () -{ - Ptr::Ref conn; - Ptr::Ref result; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - getCurrentEntryStmt)); - timestamp = Conversion::ptimeToTimestamp(TimeConversion::now(), - Conversion::roundDown); - - pstmt->setTimestamp(1, *timestamp); - pstmt->setTimestamp(2, *timestamp); - - Ptr::Ref rs(pstmt->executeQuery()); - if (rs->next()) { - Ptr::Ref id(new UniqueId(rs->getLong(1))); - Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); - - *timestamp = rs->getTimestamp(3); - Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); - - *timestamp = rs->getTimestamp(4); - Ptr::Ref endTime = Conversion::timestampToPtime(timestamp); - - result.reset(new ScheduleEntry(id, playlistId, startTime, endTime)); - } - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - // TODO: report error - return result; - } - - return result; -} - -/*------------------------------------------------------------------------------ - * Tell if a schedule entry exists. - *----------------------------------------------------------------------------*/ -bool -PostgresqlSchedule :: scheduleEntryExists( - Ptr::Ref entryId) - throw () -{ - Ptr::Ref conn; - bool result = false; - - try { - conn = cm->getConnection(); - Ptr::Ref pstmt(conn->prepareStatement( - scheduleEntryExistsStmt)); - pstmt->setLong(1, entryId->getId()); - - Ptr::Ref rs(pstmt->executeQuery()); - result = (rs->next()) ? (rs->getLong(1) == 1) : false; - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument(e.what()); - } - - return result; -} - - -/*------------------------------------------------------------------------------ - * Remove a schedule entry from a schedule - *----------------------------------------------------------------------------*/ -void -PostgresqlSchedule :: removeFromSchedule( - Ptr::Ref entryId) - throw (std::invalid_argument) -{ - Ptr::Ref conn; - bool result = false; - - try { - conn = cm->getConnection(); - Ptr::Ref pstmt(conn->prepareStatement( - removeFromScheduleStmt)); - pstmt->setLong(1, entryId->getId()); - - result = pstmt->executeUpdate() == 1; - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument(e.what()); - } - - if (!result) { - throw std::invalid_argument("specified schedule entry does not exist"); - } -} - - -/*------------------------------------------------------------------------------ - * Get a ScheduleEntry based on a schedule entry id. - *----------------------------------------------------------------------------*/ -Ptr::Ref -PostgresqlSchedule :: getScheduleEntry(Ptr::Ref entryId) - throw (std::invalid_argument) -{ - Ptr::Ref conn; - Ptr::Ref entry; - - try { - conn = cm->getConnection(); - Ptr::Ref pstmt(conn->prepareStatement( - getScheduleEntryStmt)); - pstmt->setLong(1, entryId->getId()); - - Ptr::Ref rs(pstmt->executeQuery()); - if (rs->next()) { - Ptr::Ref timestamp(new Timestamp()); - - Ptr::Ref id(new UniqueId(rs->getLong(1))); - Ptr::Ref playlistId(new UniqueId(rs->getLong(2))); - - *timestamp = rs->getTimestamp(3); - Ptr::Ref startTime = Conversion::timestampToPtime(timestamp); - - *timestamp = rs->getTimestamp(4); - Ptr::Ref endTime = Conversion::timestampToPtime(timestamp); - - entry.reset(new ScheduleEntry(id, playlistId, startTime, endTime)); - } - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - // TODO: report error - return entry; - } - - if (!entry) { - throw std::invalid_argument("no schedule entry by the specified id"); - } - - return entry; -} - - -/*------------------------------------------------------------------------------ - * Reschedule an entry - *----------------------------------------------------------------------------*/ -void -PostgresqlSchedule :: reschedule(Ptr::Ref entryId, - Ptr::Ref playtime) - throw (std::invalid_argument) -{ - Ptr::Ref entry = getScheduleEntry(entryId); - - Ptr::Ref ends(new ptime((*playtime) - + *(entry->getPlaylength()))); - - if (!isTimeframeAvailable(playtime, ends)) { - throw std::invalid_argument("new playtime not available"); - } - - Ptr::Ref conn; - bool result = false; - - try { - conn = cm->getConnection(); - Ptr::Ref timestamp; - Ptr::Ref pstmt(conn->prepareStatement( - reschedulePlaylistStmt)); - - timestamp = Conversion::ptimeToTimestamp(playtime, - Conversion::roundNearest); - pstmt->setTimestamp(1, *timestamp); - - timestamp = Conversion::ptimeToTimestamp(ends, - Conversion::roundUp); - pstmt->setTimestamp(2, *timestamp); - - pstmt->setLong(3, entryId->getId()); - - result = pstmt->executeUpdate() == 1; - - cm->returnConnection(conn); - } catch (std::exception &e) { - if (conn) { - cm->returnConnection(conn); - } - throw std::invalid_argument(e.what()); - } - - if (!result) { - throw std::invalid_argument("couldn't insert into database"); - } -} - - diff --git a/src/products/scheduler/src/PostgresqlSchedule.h b/src/products/scheduler/src/PostgresqlSchedule.h deleted file mode 100644 index 7e0dab3d3..000000000 --- a/src/products/scheduler/src/PostgresqlSchedule.h +++ /dev/null @@ -1,401 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PostgresqlSchedule_h -#define PostgresqlSchedule_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Db/ConnectionManagerInterface.h" -#include "ScheduleInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An object containing the schedule of events in a PostreSQL database. - * - * This object has to be configured with a simple empty element, as - * the following: - * - *

- *      <postgresqlSchedule/>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT postgresqlSchedule EMPTY >
- *  
- * - */ -class PostgresqlSchedule : public Configurable, - public ScheduleInterface -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The name of the schedule export element - */ - static const std::string scheduleExportElementName; - - /** - * The name of the fromTime attribute - */ - static const std::string fromTimeAttrName; - - /** - * The name of the toTime attribute - */ - static const std::string toTimeAttrName; - - /** - * A SQL statement to check if the database can be accessed. - */ - static const std::string check1Stmt; - - /** - * A SQL statement to check if the schedule table exists. - */ - static const std::string scheduleCountStmt; - - /** - * The SQL statement for querying if a time frame is available. - */ - static const std::string isTimeframaAvailableStmt; - - /** - * The SQL statement for scheduling a playlist. - */ - static const std::string schedulePlaylistStmt; - - /** - * The SQL statement for rescheduling an entry. - */ - static const std::string reschedulePlaylistStmt; - - /** - * The SQL statement for getting a schedule entry based on its id - */ - static const std::string getScheduleEntryStmt; - - /** - * The SQL statement for getting the schedules for a time interval - */ - static const std::string getScheduleEntriesStmt; - - /** - * The SQL statement for getting the currently playing schedule - * entry. - */ - static const std::string getCurrentlyPlayingStmt; - - /** - * The SQL statement for getting the next schedule entry after a - * timepoint. - */ - static const std::string getNextEntryStmt; - - /** - * The SQL statement for getting current schedule entry - */ - static const std::string getCurrentEntryStmt; - - /** - * The SQL statement for telling if a schedule entry exists. - */ - static const std::string scheduleEntryExistsStmt; - - /** - * The SQL statement for removing a schedule entry. - */ - static const std::string removeFromScheduleStmt; - - /** - * The database connection manager to use for connecting the - * database. - */ - Ptr::Ref cm; - - /** - * The default constructor. - */ - PostgresqlSchedule(void) throw() - { - } - - - public: - /** - * Construct a PostgresqlSchedule. - * - * @param cm the connection manager the PostgresqlSchedule will use to - * connect to the database. - */ - PostgresqlSchedule(Ptr::Ref cm) - throw () - { - this->cm = cm; - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~PostgresqlSchedule(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Configure the object based on the XML element supplied. - * The supplied element is expected to be of the name - * returned by configElementName(). - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Check if a timeframe is available for scheduling. - * - * @param from the start time of the timeframe. - * @param to the end time of the timeframe. - * @return true if the timeframe is available, false otherwise. - */ - virtual bool - isTimeframeAvailable(Ptr::Ref from, - Ptr::Ref to) throw (); - - /** - * Schedule a playlist. - * - * @param playlist the playlist to schedule. - * @param playtime the time to schedule the playlist for. - * @return the id of the newly created playlist. - * @exception std::invalid_argument if the there is something - * already scheduled for the duration of the playlist. - */ - virtual Ptr::Ref - schedulePlaylist(Ptr::Ref playlist, - Ptr::Ref playtime) - throw (std::invalid_argument); - - /** - * Return the list of scheduled entries for a specified time interval. - * It returns all entries which intersect the interval (i.e., start - * before toTime, and end later than fromTime). - * - * @param fromTime the start of the time of the interval queried - * @param toTime to end of the time of the interval queried - * @return a vector of the scheduled entries for the time region. - */ - virtual Ptr::Ref - getScheduleEntries(Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (); - - /** - * Export schedule entries to a DOM tree. - * - * @param element a new DOM element will be added as a child to - * this element, which will contain the export. - * @param fromTime entries are included in the export starting - * from this time. - * @param toTime entries as included in the export up to - * but not including this time. - * @return a DOM element, which is the export. - * it is the responsibility of the caller to free up the - * returned element. - * @see #importScheduleEntries - */ - virtual void - exportScheduleEntries(xmlpp::Element * element, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw (); - - /** - * Import schedule entries from a DOM tree. - * - * @param element the DOM element containing schedule entries - * to import. - * @exception std::invalid_argument if the supplied DOM tree - * is not valid. - * @see #exportScheduleEntries - */ - virtual void - importScheduleEntries(const xmlpp::Element * element) - throw (std::invalid_argument); - - /** - * Return the schedule entry that is being played at the moment. - * - * @return the schedule entry that is being played at the monent, - * or a reference to null, if nothing is playing currently. - */ - virtual Ptr::Ref - getCurrentlyPlaying(void) throw (); - - /** - * Return the next schedule entry, after (but not including) - * the specified timepoint. - * - * @param fromTime the start of the time of the interval queried, - * inclusive - * @return the first schedule entry, after the specified timepoint. - */ - virtual Ptr::Ref - getNextEntry(Ptr::Ref fromTime) - throw (); - - /** - * Return current schedule entry - * - * @param - * - * @return the first schedule entry at this point in time - */ - virtual Ptr::Ref - getCurrentEntry() - throw (); - - /** - * Tell if a schedule entry exists by the give name. - * - * @param entryId the id of the schedule entry to check for. - * @return true if the schedule entry exists in the Schedule, - * false otherwise. - */ - virtual bool - scheduleEntryExists(Ptr::Ref entryId) - throw (); - - /** - * Remove a schedule entry from the schedule. - * - * @param entryId the id of the schedule to remove. - * @exception std::invalid_argument if no schedule with the specified - * id exists. - */ - virtual void - removeFromSchedule(Ptr::Ref entryId) - throw (std::invalid_argument); - - /** - * Return a schedule entry for a specified id. - * - * @param entryId the id of the entry to get. - * @return the ScheduleEntry for the specified id. - * @exception std::invalid_argument if no entry by the specified - * id exists. - */ - virtual Ptr::Ref - getScheduleEntry(Ptr::Ref entryId) - throw (std::invalid_argument); - - /** - * Insert a schedule entry into the database. - * - * @param scheduleEntry the schedule entry to process. - * @exception std::invalid_argument if the there is something - * already scheduled for the duration of the playlist. - */ - virtual void - storeScheduleEntry(Ptr::Ref scheduleEntry) - throw (std::invalid_argument); - - /** - * Reschedule an event to a different time. - * - * @param entryId the id of the entry to reschedule. - * @param playtime the new time for the schedule. - * @exception std::invalid_argument if there is something already - * scheduled for the new duration. - */ - virtual void - reschedule(Ptr::Ref entryId, - Ptr::Ref playtime) - throw (std::invalid_argument); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PostgresqlSchedule_h - diff --git a/src/products/scheduler/src/PostgresqlScheduleTest.cxx b/src/products/scheduler/src/PostgresqlScheduleTest.cxx deleted file mode 100644 index 9eda6e485..000000000 --- a/src/products/scheduler/src/PostgresqlScheduleTest.cxx +++ /dev/null @@ -1,594 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "SchedulerDaemon.h" -#include "PostgresqlSchedule.h" -#include "PostgresqlScheduleTest.h" - - -using namespace boost::posix_time; -using namespace xmlpp; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(PostgresqlScheduleTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - cm = scheduler->getConnectionManager(); - - schedule.reset(new PostgresqlSchedule(cm)); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - schedule.reset(); - cm.reset(); -} - - -/*------------------------------------------------------------------------------ - * Test for an available timeframe in an empty schedule database. - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - // check with any two arbitary dates, the timeframe should be available - Ptr::Ref from(new ptime(time_from_string("2004-07-23 10:00:00"))); - Ptr::Ref to(new ptime(time_from_string("2004-07-23 11:00:00"))); - - CPPUNIT_ASSERT(schedule->isTimeframeAvailable(from, to)); -} - - -/*------------------------------------------------------------------------------ - * Schedule a single playlist. - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: simpleScheduleTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist, from 10 o'clock 2004-07-23 - Ptr::Ref id = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(id, playlength)); - Ptr::Ref from(new ptime(time_from_string( - "2004-07-23 10:00:00"))); - - try { - schedule->schedulePlaylist(playlist, from); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Schedule a single playlist, and then query for available timeframes - * around it. - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: scheduleAndQueryTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist, from 10 o'clock 2004-07-23 - Ptr::Ref id = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(id, playlength)); - Ptr::Ref from(new ptime(time_from_string( - "2004-07-23 10:00:00"))); - - try { - schedule->schedulePlaylist(playlist, from); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } - - // check for available timeframes around the inserted one - Ptr::Ref to; - - // this is the exact same timeframe as the scheduled playlist - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 11:00:00"))); - - CPPUNIT_ASSERT(!schedule->isTimeframeAvailable(from, to)); - - // a timeframe before our playlist - from.reset(new ptime(time_from_string("2004-07-23 09:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 09:50:00"))); - - CPPUNIT_ASSERT(schedule->isTimeframeAvailable(from, to)); - - // a timeframe after our playlist - from.reset(new ptime(time_from_string("2004-07-23 11:10:00"))); - to.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - - CPPUNIT_ASSERT(schedule->isTimeframeAvailable(from, to)); - - // a timeframe inside ours - from.reset(new ptime(time_from_string("2004-07-23 10:10:00"))); - to.reset(new ptime(time_from_string("2004-07-23 10:50:00"))); - - CPPUNIT_ASSERT(!schedule->isTimeframeAvailable(from, to)); - - // a timeframe encapsulating ours - from.reset(new ptime(time_from_string("2004-07-23 09:50:00"))); - to.reset(new ptime(time_from_string("2004-07-23 11:10:00"))); - - CPPUNIT_ASSERT(!schedule->isTimeframeAvailable(from, to)); - - // a timeframe starting earlier, but flowing into ours - from.reset(new ptime(time_from_string("2004-07-23 09:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 10:10:00"))); - - CPPUNIT_ASSERT(!schedule->isTimeframeAvailable(from, to)); - - // a timeframe starting inside ours, and continuing afterwards - from.reset(new ptime(time_from_string("2004-07-23 10:50:00"))); - to.reset(new ptime(time_from_string("2004-07-23 11:50:00"))); - - CPPUNIT_ASSERT(!schedule->isTimeframeAvailable(from, to)); - - // a timeframe ending exaclty when ours starts, which is OK - from.reset(new ptime(time_from_string("2004-07-23 09:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - - CPPUNIT_ASSERT(schedule->isTimeframeAvailable(from, to)); - - // a timeframe starting exactly when ours ends, which is OK - from.reset(new ptime(time_from_string("2004-07-23 11:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - - CPPUNIT_ASSERT(schedule->isTimeframeAvailable(from, to)); -} - - -/*------------------------------------------------------------------------------ - * See if getScheduleEntries() returns correct lists - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: getScheduleEntriesTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref from; - Ptr::Ref to; - - Ptr::Ref> >::Ref entries; - Ptr::Ref entry; - - try { - // schedule our playlist for 2004-07-23, 10 o'clock - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 12 o'clock - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 14 o'clock - from.reset(new ptime(time_from_string("2004-07-23 14:00:00"))); - schedule->schedulePlaylist(playlist, from); - - // and now let's see what's scheduled for 2004-07-23 between - // 9:00 and 11:00 - from.reset(new ptime(time_from_string("2004-07-23 09:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 11:00:00"))); - entries = schedule->getScheduleEntries(from, to); - // see that it is a single entry starting from 10 to 11 o'clock - CPPUNIT_ASSERT(entries->size() == 1); - entry = (*entries)[0]; - CPPUNIT_ASSERT(*(entry->getPlaylistId()) == *(playlist->getId())); - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - CPPUNIT_ASSERT(*(entry->getStartTime()) == *from); - to.reset(new ptime(time_from_string("2004-07-23 11:00:00"))); - CPPUNIT_ASSERT(*(entry->getEndTime()) == *to); - - // let's see what's scheduled for 2004-07-23 between - // 9:00 and 13:00 - from.reset(new ptime(time_from_string("2004-07-23 09:00:00"))); - to.reset(new ptime(time_from_string("2004-07-23 13:00:00"))); - entries = schedule->getScheduleEntries(from, to); - // see that it is 2 entries, the one at 10 and the other at 12 o'clock - CPPUNIT_ASSERT(entries->size() == 2); - // see the one at 10 o'clock - entry = (*entries)[0]; - CPPUNIT_ASSERT(*(entry->getPlaylistId()) == *(playlist->getId())); - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - CPPUNIT_ASSERT(*(entry->getStartTime()) == *from); - to.reset(new ptime(time_from_string("2004-07-23 11:00:00"))); - CPPUNIT_ASSERT(*(entry->getEndTime()) == *to); - // see the other at 12 o'clock - entry = (*entries)[1]; - CPPUNIT_ASSERT(*(entry->getPlaylistId()) == *(playlist->getId())); - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - CPPUNIT_ASSERT(*(entry->getStartTime()) == *from); - to.reset(new ptime(time_from_string("2004-07-23 13:00:00"))); - CPPUNIT_ASSERT(*(entry->getEndTime()) == *to); - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * See if getNextEntry() returns correct entry - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: getNextEntryTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref from; - Ptr::Ref entry; - - try { - // schedule our playlist for 2004-07-23, 10 o'clock - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 12 o'clock - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 14 o'clock - from.reset(new ptime(time_from_string("2004-07-23 14:00:00"))); - schedule->schedulePlaylist(playlist, from); - - // see what gives after 2004-07-23 09:00:00 - from.reset(new ptime(time_from_string("2004-07-23 09:00:00"))); - entry = schedule->getNextEntry(from); - CPPUNIT_ASSERT(entry.get()); - // see that it is a single entry starting from 10 to 11 o'clock - CPPUNIT_ASSERT(*(entry->getPlaylistId()) == *(playlist->getId())); - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - CPPUNIT_ASSERT(*(entry->getStartTime()) == *from); - - // see what gives after 2004-07-23 10:00:00 - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - entry = schedule->getNextEntry(from); - CPPUNIT_ASSERT(entry.get()); - // see that it is a single entry starting from 10 to 11 o'clock - CPPUNIT_ASSERT(*(entry->getPlaylistId()) == *(playlist->getId())); - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - CPPUNIT_ASSERT(*(entry->getStartTime()) == *from); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * See if scheduleEntryExists() returns correct results - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: scheduleEntryExistsTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref from; - Ptr::Ref to; - - Ptr::Ref entryId1; - Ptr::Ref entryId2; - - // at the very first, check for a nonexistent entry - entryId1.reset(new UniqueId(9999)); - CPPUNIT_ASSERT(!schedule->scheduleEntryExists(entryId1)); - - try { - // schedule our playlist for 2004-07-23, 10 o'clock - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - entryId1 = schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 12 o'clock - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - entryId2 = schedule->schedulePlaylist(playlist, from); - - // now let's check if our entries exist - CPPUNIT_ASSERT(schedule->scheduleEntryExists(entryId1)); - CPPUNIT_ASSERT(schedule->scheduleEntryExists(entryId2)); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * See if removeFromSchedule() really removes - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: removeFromScheduleTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref from; - Ptr::Ref to; - - Ptr::Ref entryId1; - Ptr::Ref entryId2; - - // at the very first, try to remove something not scheduled - bool gotException = false; - try { - entryId1.reset(new UniqueId(9999)); - schedule->removeFromSchedule(entryId1); - } catch (std::invalid_argument &e) { - gotException = true; - } - CPPUNIT_ASSERT(gotException); - - try { - // schedule our playlist for 2004-07-23, 10 o'clock - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - entryId1 = schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 12 o'clock - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - entryId2 = schedule->schedulePlaylist(playlist, from); - - // now let's remove one of them, and see that it's not there anymore - CPPUNIT_ASSERT(schedule->scheduleEntryExists(entryId1)); - schedule->removeFromSchedule(entryId1); - CPPUNIT_ASSERT(!schedule->scheduleEntryExists(entryId1)); - - // now let's remove the other, and see that it's not there anymore - CPPUNIT_ASSERT(schedule->scheduleEntryExists(entryId2)); - schedule->removeFromSchedule(entryId2); - CPPUNIT_ASSERT(!schedule->scheduleEntryExists(entryId2)); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Test rescheduling. - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: rescheduleTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref from; - Ptr::Ref to; - - Ptr::Ref entryId1; - Ptr::Ref entryId2; - - Ptr::Ref entry; - - // at the very first, try to reschedule something not scheduled - bool gotException = false; - try { - entryId1.reset(new UniqueId(9999)); - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - schedule->reschedule(entryId1, from); - } catch (std::invalid_argument &e) { - gotException = true; - } - CPPUNIT_ASSERT(gotException); - - try { - // schedule our playlist for 2004-07-23, 10 o'clock - from.reset(new ptime(time_from_string("2004-07-23 10:00:00"))); - entryId1 = schedule->schedulePlaylist(playlist, from); - - // schedule our playlist for 2004-07-23, 12 o'clock - from.reset(new ptime(time_from_string("2004-07-23 12:00:00"))); - entryId2 = schedule->schedulePlaylist(playlist, from); - - // now let's reschedule the first to a valid timepoint - from.reset(new ptime(time_from_string("2004-07-23 08:00:00"))); - schedule->reschedule(entryId1, from); - entry = schedule->getScheduleEntry(entryId1); - CPPUNIT_ASSERT((bool) entry); - CPPUNIT_ASSERT(*(entry->getStartTime()) == *from); - - // try to reschedule the second one into the first, should fail - gotException = false; - try { - from.reset(new ptime(time_from_string("2004-07-23 08:30:00"))); - schedule->reschedule(entryId1, from); - } catch (std::invalid_argument &e) { - gotException = true; - } - CPPUNIT_ASSERT(gotException); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL(e.what()); - } -} - - -/*------------------------------------------------------------------------------ - * Test the return of the currently playing entry - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: currentlyPlayingTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref from; - Ptr::Ref to; - Ptr::Ref duration; - - Ptr::Ref entryId; - - Ptr::Ref entry; - - // at the very first, see if null is returned if nothing is playing - // currently - entry = schedule->getCurrentlyPlaying(); - CPPUNIT_ASSERT(!entry.get()); - - // schedule our playlist for 10 seconds from now - from = TimeConversion::now(); - *from += seconds(10); - entryId = schedule->schedulePlaylist(playlist, from); - - // wait 10 seconds, so that what we've scheduled is the currently - // playing entry - duration.reset(new time_duration(seconds(10))); - TimeConversion::sleep(duration); - - // now see if the entry returned for currently playing is indeed - // what we've scheduled - entry = schedule->getCurrentlyPlaying(); - CPPUNIT_ASSERT(entry.get()); - CPPUNIT_ASSERT(entry->getId()->getId() == entryId->getId()); -} - - -/*------------------------------------------------------------------------------ - * Test export / import - *----------------------------------------------------------------------------*/ -void -PostgresqlScheduleTest :: exportImportTest(void) - throw (CPPUNIT_NS::Exception) -{ - // create a 1 hour long playlist - Ptr::Ref playlistId = UniqueId::generateId(); - Ptr::Ref playlength(new time_duration(1, 0, 0)); - Ptr::Ref playlist(new Playlist(playlistId, playlength)); - - Ptr::Ref now; - Ptr::Ref from; - Ptr::Ref to; - Ptr::Ref duration; - - Ptr::Ref entryId; - - Ptr::Ref entry; - Ptr::Ref eentry; - Ptr::Ref entries; - - Element * element; - - now = TimeConversion::now(); - - // schedule our playlist for 10 seconds from now - from.reset(new ptime(*now)); - *from += seconds(10); - entryId = schedule->schedulePlaylist(playlist, from); - entry = schedule->getScheduleEntry(entryId); - - // export the schedule - Ptr::Ref document(new Document()); - Element * root = document->create_root_node("root"); - - from.reset(new ptime(*now)); - to.reset(new ptime(*now)); - *to += minutes(1); - schedule->exportScheduleEntries(root, from, to); - - // remove the scheduled entry from the schedule - schedule->removeFromSchedule(entryId); - CPPUNIT_ASSERT(schedule->getScheduleEntries(from, to)->size() == 0); - - // import the exported schedule - element = dynamic_cast (*(root->get_children().begin())); - schedule->importScheduleEntries(element); - - // check on the timeframe, and see that its the same as it should be - entries = schedule->getScheduleEntries(from, to); - CPPUNIT_ASSERT(entries->size() == 1); - eentry = *(entries->begin()); - CPPUNIT_ASSERT(*entry == *eentry); -} - - diff --git a/src/products/scheduler/src/PostgresqlScheduleTest.h b/src/products/scheduler/src/PostgresqlScheduleTest.h deleted file mode 100644 index bf6dadb30..000000000 --- a/src/products/scheduler/src/PostgresqlScheduleTest.h +++ /dev/null @@ -1,203 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef PostgresqlScheduleTest_h -#define PostgresqlScheduleTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Db/ConnectionManagerInterface.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Db; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the PostgresqlSchedule class. - * - * @see PostgresqlSchedule - */ -class PostgresqlScheduleTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(PostgresqlScheduleTest); - CPPUNIT_TEST(firstTest); - /* - CPPUNIT_TEST(simpleScheduleTest); - CPPUNIT_TEST(scheduleAndQueryTest); - CPPUNIT_TEST(getScheduleEntriesTest); - CPPUNIT_TEST(getNextEntryTest); - CPPUNIT_TEST(scheduleEntryExistsTest); - CPPUNIT_TEST(removeFromScheduleTest); - CPPUNIT_TEST(rescheduleTest); - CPPUNIT_TEST(currentlyPlayingTest); - */ - CPPUNIT_TEST(exportImportTest); - CPPUNIT_TEST_SUITE_END(); - - private: - /** - * The connection manager used for testing. - */ - Ptr::Ref cm; - - /** - * The schedule used for testing. - */ - Ptr::Ref schedule; - - protected: - - /** - * Test for an available timeframe in an empty schedule database. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule a single playlist. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleScheduleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule a single playlist, and then query for available timeframes - * around it. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - scheduleAndQueryTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule some playlists, then get the list of scheduled playlists - * for different time intervals. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - getScheduleEntriesTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule some playlists, then get the some playlists by - * specifying a time. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - getNextEntryTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule some playlists, then check if they exist. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - scheduleEntryExistsTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule some playlists, then remove them. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - removeFromScheduleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Schedule some playlists, then reschedule them. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - rescheduleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to see if the currently playing scheduled entry is - * returned properly. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - currentlyPlayingTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test XML export / import. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - exportImportTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // PostgresqlScheduleTest_h - diff --git a/src/products/scheduler/src/RemoveFromScheduleMethod.cxx b/src/products/scheduler/src/RemoveFromScheduleMethod.cxx deleted file mode 100644 index d721221e0..000000000 --- a/src/products/scheduler/src/RemoveFromScheduleMethod.cxx +++ /dev/null @@ -1,143 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "ScheduleInterface.h" -#include "ScheduleFactory.h" -#include "SchedulerDaemon.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "RemoveFromScheduleMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string RemoveFromScheduleMethod::methodName = "removeFromSchedule"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int RemoveFromScheduleMethod::errorId = 1200; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -RemoveFromScheduleMethod :: RemoveFromScheduleMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the remove from schedule XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -RemoveFromScheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref entryId; - try { - entryId = XmlRpcTools::extractScheduleEntryId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing schedule entry ID argument", - returnValue); - return; - } - - - Ptr::Ref sf = ScheduleFactory::getInstance(); - Ptr::Ref schedule = sf->getSchedule(); - Ptr::Ref currentlyPlaying; - - try { - currentlyPlaying = schedule->getCurrentlyPlaying(); - if (currentlyPlaying.get() - && currentlyPlaying->getId()->getId() == entryId->getId()) { - XmlRpcTools::markError(errorId+4, - "the entry to be deleted is currently playing", - returnValue); - return; - } - schedule->removeFromSchedule(entryId); - - // tell the scheduler daemon to reload the scheduled events - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - scheduler->update(); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "schedule entry not found", - returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/RemoveFromScheduleMethod.h b/src/products/scheduler/src/RemoveFromScheduleMethod.h deleted file mode 100644 index 3448e3e58..000000000 --- a/src/products/scheduler/src/RemoveFromScheduleMethod.h +++ /dev/null @@ -1,144 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RemoveFromScheduleMethod_h -#define RemoveFromScheduleMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to remove a scheduled entry. - * - * The name of the method when called through XML-RPC is "removeFromSchedule". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • scheduleEntryId - string - the id of the scheduled entry - * to remove
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 1201 - invalid argument format
  • - *
  • 1202 - missing schedule entry ID argument
  • - *
  • 1203 - schedule entry not found
  • - *
  • 1204 - the entry to be deleted is currently playing
  • - *
  • 1220 - missing session ID argument
  • - *
- * - */ -class RemoveFromScheduleMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - RemoveFromScheduleMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - RemoveFromScheduleMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the remove from schedule command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RemoveFromScheduleMethod_h - diff --git a/src/products/scheduler/src/RemoveFromScheduleMethodTest.cxx b/src/products/scheduler/src/RemoveFromScheduleMethodTest.cxx deleted file mode 100644 index 9177a9eb9..000000000 --- a/src/products/scheduler/src/RemoveFromScheduleMethodTest.cxx +++ /dev/null @@ -1,270 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "ScheduleFactory.h" -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" - -#include "SchedulerDaemon.h" -#include "UploadPlaylistMethod.h" -#include "RemoveFromScheduleMethod.h" -#include "RemoveFromScheduleMethodTest.h" - - -using namespace boost::posix_time; - -using namespace LiveSupport::Authentication; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RemoveFromScheduleMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RemoveFromScheduleMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = scheduler->getStorage(); - storage->reset(); - - schedule = scheduler->getSchedule(); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } - - authentication = scheduler->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RemoveFromScheduleMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -RemoveFromScheduleMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref uploadMethod( - new UploadPlaylistMethod()); - Ptr::Ref removeMethod( - new RemoveFromScheduleMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - Ptr::Ref entryId; - - // first schedule (upload) a playlist - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - uploadMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - entryId.reset(new UniqueId(std::string(result["scheduleEntryId"]))); - - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - rootParameter[0] = parameters; - - result.clear(); - try { - removeMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } -} - - -/*------------------------------------------------------------------------------ - * A test to try to remove a not-scheduled entry - *----------------------------------------------------------------------------*/ -void -RemoveFromScheduleMethodTest :: negativeTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref removeMethod( - new RemoveFromScheduleMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - Ptr::Ref entryId(new UniqueId(9999)); - - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - rootParameter[0] = parameters; - - result.clear(); - try { - removeMethod->execute(rootParameter, result); - CPPUNIT_FAIL("allowed to remove non-existent schedule entry"); - } catch (XmlRpc::XmlRpcException &e) { - } -} - - -/*------------------------------------------------------------------------------ - * A test to try to remove a currently playing entry. - *----------------------------------------------------------------------------*/ -void -RemoveFromScheduleMethodTest :: currentlyPlayingTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref uploadMethod( - new UploadPlaylistMethod()); - Ptr::Ref removeMethod( - new RemoveFromScheduleMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - Ptr::Ref now; - struct tm time; - Ptr::Ref duration; - Ptr::Ref entryId; - bool gotException; - - // first schedule (upload) a playlist, for 10 seconds from now - now = TimeConversion::now(); - *now += seconds(10); - TimeConversion::ptimeToTm(now, time); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - uploadMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - entryId.reset(new UniqueId(std::string(result["scheduleEntryId"]))); - - // wait 10 seconds, so that what we've scheduled is the currently playing - // entry - duration.reset(new time_duration(seconds(10))); - TimeConversion::sleep(duration); - - // now try to remove what we've scheduled, this should fail - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - rootParameter[0] = parameters; - - result.clear(); - gotException = false; - try { - removeMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - gotException = true; - } - CPPUNIT_ASSERT(gotException); -} - - diff --git a/src/products/scheduler/src/RemoveFromScheduleMethodTest.h b/src/products/scheduler/src/RemoveFromScheduleMethodTest.h deleted file mode 100644 index b9d6dee5c..000000000 --- a/src/products/scheduler/src/RemoveFromScheduleMethodTest.h +++ /dev/null @@ -1,141 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RemoveFromScheduleMethodTest_h -#define RemoveFromScheduleMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the RemoveFromScheduleMethod class. - * - * @see RemoveFromScheduleMethod - */ -class RemoveFromScheduleMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(RemoveFromScheduleMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(negativeTest); - CPPUNIT_TEST(currentlyPlayingTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The schedule used during the test. - */ - Ptr::Ref schedule; - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A simple test for trying to remove a non-existent entry. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - negativeTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to try to remove an entry that's currently playing. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - currentlyPlayingTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RemoveFromScheduleMethodTest_h - diff --git a/src/products/scheduler/src/RescheduleMethod.cxx b/src/products/scheduler/src/RescheduleMethod.cxx deleted file mode 100644 index e2d8e70e3..000000000 --- a/src/products/scheduler/src/RescheduleMethod.cxx +++ /dev/null @@ -1,161 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "ScheduleInterface.h" -#include "ScheduleFactory.h" -#include "SchedulerDaemon.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "RescheduleMethod.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string RescheduleMethod::methodName = "reschedule"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int RescheduleMethod::errorId = 1300; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -RescheduleMethod :: RescheduleMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the upload playlist method XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -RescheduleMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref entryId; - try { - entryId = XmlRpcTools::extractScheduleEntryId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing schedule entry ID argument", - returnValue); - return; - } - - Ptr::Ref playschedule; - try { - playschedule = XmlRpcTools::extractPlayschedule(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "missing playtime argument", - returnValue); - return; - } - - Ptr::Ref scheduleEntryId; - - Ptr::Ref sf = ScheduleFactory::getInstance(); - Ptr::Ref schedule = sf->getSchedule(); - Ptr::Ref currentlyPlaying; - - if (!schedule->scheduleEntryExists(entryId)) { - XmlRpcTools::markError(errorId+4, "schedule entry not found", - returnValue); - return; - } - currentlyPlaying = schedule->getCurrentlyPlaying(); - if (currentlyPlaying.get() - && currentlyPlaying->getId()->getId() == entryId->getId()) { - XmlRpcTools::markError(errorId+6, - "the entry to be rescheduled is currently playing", - returnValue); - return; - } - try { - schedule->reschedule(entryId, playschedule); - - // tell the scheduler daemon to reload the scheduled events - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - scheduler->update(); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+5, e.what(), - returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/RescheduleMethod.h b/src/products/scheduler/src/RescheduleMethod.h deleted file mode 100644 index bc9228f38..000000000 --- a/src/products/scheduler/src/RescheduleMethod.h +++ /dev/null @@ -1,147 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RescheduleMethod_h -#define RescheduleMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to reschedule an already scheduled event. - * - * The name of the method when called through XML-RPC is "reschedule". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • scheduleEntryId - string - the id of the schedule entry - * to reschedule
  • - *
  • playtime - datetime - the new playing time for the entry
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 1301 - invalid argument format
  • - *
  • 1302 - missing schedule entry ID argument
  • - *
  • 1303 - missing playtime argument
  • - *
  • 1304 - schedule entry not found
  • - *
  • 1305 - could not reschedule entry
  • - *
  • 1306 - the entry to be rescheduled is currently playing
  • - *
  • 1320 - missing session ID argument
  • - *
- * - */ -class RescheduleMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - RescheduleMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - RescheduleMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the upload playlist command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RescheduleMethod_h - diff --git a/src/products/scheduler/src/RescheduleMethodTest.cxx b/src/products/scheduler/src/RescheduleMethodTest.cxx deleted file mode 100644 index 10080eeb0..000000000 --- a/src/products/scheduler/src/RescheduleMethodTest.cxx +++ /dev/null @@ -1,271 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include - -#include "LiveSupport/Core/TimeConversion.h" -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" - -#include "SchedulerDaemon.h" -#include "ScheduleFactory.h" -#include "UploadPlaylistMethod.h" -#include "RescheduleMethod.h" -#include "RescheduleMethodTest.h" - -using namespace LiveSupport::Db; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RescheduleMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RescheduleMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = scheduler->getStorage(); - storage->reset(); - - schedule = scheduler->getSchedule(); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } - - authentication = scheduler->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RescheduleMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -RescheduleMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref uploadMethod(new UploadPlaylistMethod()); - Ptr::Ref rescheduleMethod(new RescheduleMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - Ptr::Ref entryId; - - // let's upload something so we can reschedule it - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 18; - time.tm_min = 31; - time.tm_sec = 1; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - uploadMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - entryId.reset(new UniqueId(std::string(result["scheduleEntryId"]))); - - // now let's reschedule it - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 12; - time.tm_min = 31; - time.tm_sec = 1; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - rescheduleMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - - // now let's reschedule unto itself, should fail - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 12; - time.tm_min = 51; - time.tm_sec = 1; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - rescheduleMethod->execute(rootParameter, result); - CPPUNIT_FAIL("allowed to schedule playlist onto itself"); - } catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 1305); - } -} - - -/*------------------------------------------------------------------------------ - * Test to see if rescheduling the currently playing entry works (should not) - *----------------------------------------------------------------------------*/ -void -RescheduleMethodTest :: currentlyPlayingTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref uploadMethod(new UploadPlaylistMethod()); - Ptr::Ref rescheduleMethod(new RescheduleMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - Ptr::Ref now; - Ptr::Ref duration; - bool gotException; - Ptr::Ref entryId; - - // let's upload something so we can reschedule it - now = TimeConversion::now(); - *now += seconds(10); - TimeConversion::ptimeToTm(now, time); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - uploadMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - entryId.reset(new UniqueId(std::string(result["scheduleEntryId"]))); - - // wait 10 seconds, so that what we've scheduled is the currently playing - // entry - duration.reset(new time_duration(seconds(10))); - TimeConversion::sleep(duration); - - // now let's try reschedule it, which should fail - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 12; - time.tm_min = 31; - time.tm_sec = 1; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - gotException = false; - try { - rescheduleMethod->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - gotException = true; - } - CPPUNIT_ASSERT(gotException); -} - diff --git a/src/products/scheduler/src/RescheduleMethodTest.h b/src/products/scheduler/src/RescheduleMethodTest.h deleted file mode 100644 index 9202a2e0d..000000000 --- a/src/products/scheduler/src/RescheduleMethodTest.h +++ /dev/null @@ -1,133 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RescheduleMethodTest_h -#define RescheduleMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the RescheduleMethod class. - * - * @see RescheduleMethod - */ -class RescheduleMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(RescheduleMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(currentlyPlayingTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The schedule used during the test. - */ - Ptr::Ref schedule; - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to see if rescheduling the currently playing entry works. - * (should not) - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - currentlyPlayingTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RescheduleMethodTest_h - diff --git a/src/products/scheduler/src/ResetStorageMethod.cxx b/src/products/scheduler/src/ResetStorageMethod.cxx deleted file mode 100644 index bdf5212dc..000000000 --- a/src/products/scheduler/src/ResetStorageMethod.cxx +++ /dev/null @@ -1,94 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Core/XmlRpcTools.h" - -#include "ResetStorageMethod.h" - - -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string ResetStorageMethod::methodName = "resetStorage"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int ResetStorageMethod::errorId = 3000; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -ResetStorageMethod :: ResetStorageMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the XML-RPC function call. - * (Overrides 'execute' in XmlRpcServerMethod.) - *----------------------------------------------------------------------------*/ -void -ResetStorageMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - Ptr::Ref scf - = StorageClientFactory::getInstance(); - Ptr::Ref storage - = scf->getStorageClient(); - - try { - storage->reset(); - } catch (Core::XmlRpcException &e) { - std::string eMsg = "storage reset() returned error:\n"; - eMsg += e.what(); - XmlRpcTools::markError(errorId+1, eMsg, returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/ResetStorageMethod.h b/src/products/scheduler/src/ResetStorageMethod.h deleted file mode 100644 index a089edf17..000000000 --- a/src/products/scheduler/src/ResetStorageMethod.h +++ /dev/null @@ -1,128 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ResetStorageMethod_h -#define ResetStorageMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to reset the storage to its initial value. - * - * The name of the method when called through XML-RPC is "resetStorage". - * - * No parameters are required, and normally nothing is returned. - * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 3001 - storage client reported an error
  • - *
- * - */ -class ResetStorageMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - ResetStorageMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - ResetStorageMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the reset storage command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // ResetStorageMethod_h - diff --git a/src/products/scheduler/src/ResetStorageMethodTest.cxx b/src/products/scheduler/src/ResetStorageMethodTest.cxx deleted file mode 100644 index 937cd1334..000000000 --- a/src/products/scheduler/src/ResetStorageMethodTest.cxx +++ /dev/null @@ -1,84 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include - -#include "ResetStorageMethodTest.h" - - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(ResetStorageMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -ResetStorageMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -ResetStorageMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ -} - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -ResetStorageMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/ResetStorageMethodTest.h b/src/products/scheduler/src/ResetStorageMethodTest.h deleted file mode 100644 index 89f5f10a4..000000000 --- a/src/products/scheduler/src/ResetStorageMethodTest.h +++ /dev/null @@ -1,102 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ResetStorageMethodTest_h -#define ResetStorageMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "BaseTestMethod.h" - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the ResetStorageMethod class. - * - * @see ResetStorageMethod - */ -class ResetStorageMethodTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(ResetStorageMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST_SUITE_END(); - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // ResetStorageMethodTest_h - diff --git a/src/products/scheduler/src/RestoreBackupMethod.cxx b/src/products/scheduler/src/RestoreBackupMethod.cxx deleted file mode 100644 index 5e27d2c23..000000000 --- a/src/products/scheduler/src/RestoreBackupMethod.cxx +++ /dev/null @@ -1,123 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision$ - Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/branches/scheduler_export/livesupport/src/products/scheduler/src/RestoreBackupMethod.cxx $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include "LiveSupport/Core/XmlRpcTools.h" -#include "LiveSupport/Core/XmlRpcException.h" -#include "BackupFactory.h" - -#include "RestoreBackupMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string RestoreBackupMethod::methodName = "restoreBackup"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int RestoreBackupMethod::errorId = 4500; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -RestoreBackupMethod :: RestoreBackupMethod ( - Ptr::Ref xmlRpcServer) - throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the upload playlist method XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -RestoreBackupMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref path; - try{ - path = XmlRpcTools::extractPath(parameters); - - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, - "missing path argument", - returnValue); - return; - } - - Ptr::Ref bf = BackupFactory::getInstance(); - Ptr::Ref backup = bf->getBackup(); - try { - backup->restoreBackup(sessionId, path); - - } catch (Core::XmlRpcException &e) { - XmlRpcTools::markError(errorId+10, e.what(), returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/RestoreBackupMethod.h b/src/products/scheduler/src/RestoreBackupMethod.h deleted file mode 100644 index 67c4f8632..000000000 --- a/src/products/scheduler/src/RestoreBackupMethod.h +++ /dev/null @@ -1,141 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision$ - Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/branches/scheduler_export/livesupport/src/products/scheduler/src/RestoreBackupMethod.h $ - -------------------------------------------------------------------------------*/ -#ifndef RestoreBackupMethod_h -#define RestoreBackupMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to restore a schedule backup. - * - * The name of the method when called through XML-RPC is "restoreBackup". - * - * The expected parameter is an XML-RPC structure with these members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client;
  • - *
  • path - string - the local path and filename of the backup - * archive to be restored.
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 4501 - invalid argument format
  • - *
  • 4502 - missing path argument
  • - *
  • 4510 - error reported by the scheduler daemon
  • - *
  • 4520 - missing session ID argument
  • - *
- * - * @author $Author: fgerlits $ - * @version $Revision$ - */ -class RestoreBackupMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - RestoreBackupMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - RestoreBackupMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the createBackupOpen command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RestoreBackupMethod_h - diff --git a/src/products/scheduler/src/RpcBackupTest.cxx b/src/products/scheduler/src/RpcBackupTest.cxx deleted file mode 100644 index 28bb4c792..000000000 --- a/src/products/scheduler/src/RpcBackupTest.cxx +++ /dev/null @@ -1,315 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include - -#include -#include - -#include "LiveSupport/Core/UniqueId.h" -#include "LiveSupport/Core/XmlRpcTools.h" -#include "LiveSupport/Core/FileTools.h" -#include "SchedulerDaemon.h" -#include "PlayLogFactory.h" - -#include "RpcBackupTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcBackupTest); - -namespace { - -/** - * The name of the configuration file for the scheduler daemon - */ -const std::string configFileName = "etc/scheduler.xml"; - -/** - * The location of the temporary backup file - */ -const std::string tempBackupTarFileName = "tmp/scheduleBackup.tar"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcBackupTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcBackupTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); - - remove(tempBackupTarFileName.c_str()); -} - - -/*------------------------------------------------------------------------------ - * Create the backup. - *----------------------------------------------------------------------------*/ -void -RpcBackupTest :: createBackup(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - Ptr::Ref criteria(new SearchCriteria); - criteria->setLimit(10); - Ptr::Ref from(new ptime(time_from_string("2004-07-23 10:00:00"))); - Ptr::Ref to(new ptime(time_from_string("2004-07-23 11:00:00"))); - - XmlRpcTools::sessionIdToXmlRpcValue(sessionId, parameters); - XmlRpcTools::searchCriteriaToXmlRpcValue(criteria, parameters); - XmlRpcTools::fromTimeToXmlRpcValue(from, parameters); - XmlRpcTools::toTimeToXmlRpcValue(to, parameters); - - CPPUNIT_ASSERT(xmlRpcClient.execute("createBackupOpen", - parameters, - result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - Ptr::Ref token; - CPPUNIT_ASSERT_NO_THROW( - token = XmlRpcTools::extractToken(result); - ); - - AsyncState status; - parameters.clear(); - XmlRpcTools::tokenToXmlRpcValue(token, parameters); - int iterations = 20; - do { - std::cerr << "-/|\\"[iterations%4] << '\b'; - sleep(1); - result.clear(); - CPPUNIT_ASSERT(xmlRpcClient.execute("createBackupCheck", - parameters, - result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - CPPUNIT_ASSERT_NO_THROW( - status = XmlRpcTools::extractBackupStatus(result); - ); - CPPUNIT_ASSERT(status == AsyncState::pendingState - || status == AsyncState::finishedState - || status == AsyncState::failedState); - } while (--iterations && status == AsyncState::pendingState); - - CPPUNIT_ASSERT_EQUAL(AsyncState::finishedState, status); - // TODO: test accessibility of the URL? - - Ptr::Ref url; - Ptr::Ref path; - Ptr::Ref errorMessage; - - CPPUNIT_ASSERT_NO_THROW( - url = XmlRpcTools::extractUrl(result); - ); - CPPUNIT_ASSERT_NO_THROW( - path = XmlRpcTools::extractPath(result); - ); - - // copy the backup file - CPPUNIT_ASSERT_NO_THROW( - remove(tempBackupTarFileName.c_str()); - std::ifstream ifs(path->c_str(), std::ios::binary); - std::ofstream ofs(tempBackupTarFileName.c_str(), std::ios::binary); - ofs << ifs.rdbuf(); - ); - - parameters.clear(); - XmlRpcTools::tokenToXmlRpcValue(token, parameters); - result.clear(); - CPPUNIT_ASSERT(xmlRpcClient.execute("createBackupClose", - parameters, - result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Test the createBackupXxxx methods. - *----------------------------------------------------------------------------*/ -void -RpcBackupTest :: createBackupTest(void) - throw (CPPUNIT_NS::Exception) -{ - // Create the backup. - CPPUNIT_ASSERT_NO_THROW( - createBackup() - ); - - // Check the backup file. - bool exists; - std::string schedulerBackupInTarball = "meta-inf/scheduler.xml"; - CPPUNIT_ASSERT_NO_THROW( - exists = FileTools::existsInTarball(tempBackupTarFileName, - schedulerBackupInTarball) - ); - CPPUNIT_ASSERT(exists); - - std::string extractedTempFileName = "tmp/scheduler.tmp.xml"; - FILE * file; - - remove(extractedTempFileName.c_str()); - file = fopen(extractedTempFileName.c_str(), "r"); - CPPUNIT_ASSERT(file == 0); - - CPPUNIT_ASSERT_NO_THROW( - FileTools::extractFileFromTarball(tempBackupTarFileName, - schedulerBackupInTarball, - extractedTempFileName) - ); - - file = fopen(extractedTempFileName.c_str(), "r"); - CPPUNIT_ASSERT(file != 0); - CPPUNIT_ASSERT(fclose(file) == 0); - - CPPUNIT_ASSERT(remove(extractedTempFileName.c_str()) == 0); - file = fopen(extractedTempFileName.c_str(), "r"); - CPPUNIT_ASSERT(file == 0); -} - - -/*------------------------------------------------------------------------------ - * Test the restoreBackup method. - *----------------------------------------------------------------------------*/ -void -RpcBackupTest :: restoreBackupTest(void) - throw (CPPUNIT_NS::Exception) -{ - // Create the backup. - CPPUNIT_ASSERT_NO_THROW( - createBackup() - ); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(sessionId); - Ptr::Ref path(new const Glib::ustring( - tempBackupTarFileName)); - - XmlRpcTools::sessionIdToXmlRpcValue(sessionId, parameters); - XmlRpcTools::pathToXmlRpcValue(path, parameters); - - CPPUNIT_ASSERT(xmlRpcClient.execute("restoreBackup", - parameters, - result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); - // TODO: try this with a non-empty backup file, too -} - diff --git a/src/products/scheduler/src/RpcBackupTest.h b/src/products/scheduler/src/RpcBackupTest.h deleted file mode 100644 index cc8538a5b..000000000 --- a/src/products/scheduler/src/RpcBackupTest.h +++ /dev/null @@ -1,128 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcBackupTest_h -#define RpcBackupTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the BackupMethod class. - * - * @see BackupMethod - */ -class RpcBackupTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcBackupTest); - CPPUNIT_TEST(createBackupTest); - CPPUNIT_TEST(restoreBackupTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Auxiliary method: create the backup file. Used by both tests. - */ - void - createBackup(void) throw (CPPUNIT_NS::Exception); - - - protected: - - /** - * Test the createBackupXxxx methods. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - createBackupTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test the restoreBackup method. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - restoreBackupTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcBackupTest_h - diff --git a/src/products/scheduler/src/RpcDisplayScheduleTest.cxx b/src/products/scheduler/src/RpcDisplayScheduleTest.cxx deleted file mode 100644 index 9080db191..000000000 --- a/src/products/scheduler/src/RpcDisplayScheduleTest.cxx +++ /dev/null @@ -1,238 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include - -#include "SchedulerDaemon.h" - -#include "RpcDisplayScheduleTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcDisplayScheduleTest); - -/** - * The name of the configuration file for the scheduler daemon. - */ -static const std::string configFileName = "etc/scheduler.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcDisplayScheduleTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcDisplayScheduleTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Test a simple query, resulting in an empty result set. - *----------------------------------------------------------------------------*/ -void -RpcDisplayScheduleTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpcValue parameters; - XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // list the schedules for an interval (as the database is empty, - // it's going to return an empty result set) - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 2044; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 2044; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 11; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - - result.clear(); - xmlRpcClient.execute("displaySchedule", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.size() == 0); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Testing some error conditions. - *----------------------------------------------------------------------------*/ -void -RpcDisplayScheduleTest :: faultTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - result.clear(); - xmlRpcClient.execute("displaySchedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("faultCode")); - CPPUNIT_ASSERT(int(result["faultCode"]) == 1101); - - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["from"] = "the beginning"; - parameters["to"] = "the end"; - - result.clear(); - xmlRpcClient.execute("displaySchedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("faultCode")); - CPPUNIT_ASSERT(int(result["faultCode"]) == 1102); -/* - struct tm time; - - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 2044; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 2044; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 11; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - - result.clear(); - xmlRpcClient.execute("displaySchedule", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.size() == 0); -*/ - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/RpcDisplayScheduleTest.h b/src/products/scheduler/src/RpcDisplayScheduleTest.h deleted file mode 100644 index b209404ff..000000000 --- a/src/products/scheduler/src/RpcDisplayScheduleTest.h +++ /dev/null @@ -1,120 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcDisplayScheduleTest_h -#define RpcDisplayScheduleTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the displaySchedule XML-RPC call. - * - * @see SchedulerDaemon - */ -class RpcDisplayScheduleTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcDisplayScheduleTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(faultTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - protected: - - /** - * Simple test for an empty query. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Test some error conditions. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - faultTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcDisplayScheduleTest_h - diff --git a/src/products/scheduler/src/RpcGeneratePlayReportTest.cxx b/src/products/scheduler/src/RpcGeneratePlayReportTest.cxx deleted file mode 100644 index 045315001..000000000 --- a/src/products/scheduler/src/RpcGeneratePlayReportTest.cxx +++ /dev/null @@ -1,389 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "LiveSupport/Core/UniqueId.h" -#include "SchedulerDaemon.h" -#include "PlayLogFactory.h" - -#include "RpcGeneratePlayReportTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcGeneratePlayReportTest); - -/** - * The name of the configuration file for the scheduler daemon - */ -static const std::string configFileName = "etc/scheduler.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcGeneratePlayReportTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - - insertEntries(); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcGeneratePlayReportTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Insert some entries into the play log - *----------------------------------------------------------------------------*/ -void -RpcGeneratePlayReportTest :: insertEntries(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref plf = PlayLogFactory::getInstance(); - Ptr::Ref playLog = plf->getPlayLog(); - - Ptr::Ref audioClipId(new UniqueId(10001)); - Ptr::Ref timestamp(new ptime(time_from_string( - "2004-10-26 14:00:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - audioClipId.reset(new UniqueId(10017)); - timestamp.reset(new ptime(time_from_string("2004-10-26 15:30:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); - - audioClipId.reset(new UniqueId(10003)); - timestamp.reset(new ptime(time_from_string("2004-10-27 10:01:00"))); - playLog->addPlayLogEntry(audioClipId, timestamp); -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -RpcGeneratePlayReportTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // set up a structure for the parameters - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 101; // 2001 - time.tm_mon = 10; // November - time.tm_mday = 12; - time.tm_hour = 18; - time.tm_min = 31; - time.tm_sec = 1; - parameters["from"] = &time; - time.tm_year = 101; // 2001 - time.tm_mon = 10; // November - time.tm_mday = 12; - time.tm_hour = 19; - time.tm_min = 31; - time.tm_sec = 1; - parameters["to"] = &time; - - CPPUNIT_ASSERT(xmlRpcClient.execute("generatePlayReport", - parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.size() == 0); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Look at some intervals and check against test data - *----------------------------------------------------------------------------*/ -void -RpcGeneratePlayReportTest :: intervalTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // check for the interval 2004-10-26 between 13 and 15 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 13; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 15; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - - CPPUNIT_ASSERT(xmlRpcClient.execute("generatePlayReport", - parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - // check the returned values - CPPUNIT_ASSERT(result.size() == 1); - CPPUNIT_ASSERT(result[0].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[0]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - UniqueId newAudioClipId = UniqueId(std::string(result[0]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10001); - - CPPUNIT_ASSERT(result[0].hasMember("timestamp")); - CPPUNIT_ASSERT(result[0]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[0]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 26); - CPPUNIT_ASSERT(time.tm_hour == 14); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - - - // check for the interval 2004-10-26 between 14 o'clock and 15:30 - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 14; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 15; - time.tm_min = 30; - time.tm_sec = 0; - parameters["to"] = &time; - - result.clear(); - CPPUNIT_ASSERT(xmlRpcClient.execute("generatePlayReport", - parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - // check the returned values - CPPUNIT_ASSERT(result.size() == 1); - CPPUNIT_ASSERT(result[0].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[0]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - newAudioClipId = UniqueId(std::string(result[0]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10001); - - CPPUNIT_ASSERT(result[0].hasMember("timestamp")); - CPPUNIT_ASSERT(result[0]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[0]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 26); - CPPUNIT_ASSERT(time.tm_hour == 14); - CPPUNIT_ASSERT(time.tm_min == 0); - CPPUNIT_ASSERT(time.tm_sec == 0); - - - // check for the interval 2004-10-26 15:00 to 2012-08-01 midnight - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 15; - time.tm_min = 30; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 112; // 2012 - time.tm_mon = 7; // August - time.tm_mday = 1; - time.tm_hour = 0; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - - result.clear(); - CPPUNIT_ASSERT(xmlRpcClient.execute("generatePlayReport", - parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - // check the returned values - CPPUNIT_ASSERT(result.size() == 2); - CPPUNIT_ASSERT(result[0].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[0]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - newAudioClipId = UniqueId(std::string(result[0]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10017); - - CPPUNIT_ASSERT(result[0].hasMember("timestamp")); - CPPUNIT_ASSERT(result[0]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[0]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 26); - CPPUNIT_ASSERT(time.tm_hour == 15); - CPPUNIT_ASSERT(time.tm_min == 30); - CPPUNIT_ASSERT(time.tm_sec == 0); - - CPPUNIT_ASSERT(result[1].hasMember("audioClipId")); - CPPUNIT_ASSERT(result[1]["audioClipId"].getType() - == XmlRpc::XmlRpcValue::TypeString); - newAudioClipId = UniqueId(std::string(result[1]["audioClipId"])); - CPPUNIT_ASSERT(newAudioClipId.getId() == 10003); - - CPPUNIT_ASSERT(result[1].hasMember("timestamp")); - CPPUNIT_ASSERT(result[1]["timestamp"].getType() - == XmlRpc::XmlRpcValue::TypeDateTime); - time = result[1]["timestamp"]; - CPPUNIT_ASSERT(time.tm_year == 104); // 2004 - CPPUNIT_ASSERT(time.tm_mon == 9); // October - CPPUNIT_ASSERT(time.tm_mday == 27); - CPPUNIT_ASSERT(time.tm_hour == 10); - CPPUNIT_ASSERT(time.tm_min == 01); - CPPUNIT_ASSERT(time.tm_sec == 0); - - - // check for the interval 2004-10-26 16 o'clock to 2004-10-27 10 o'clock - parameters["sessionId"] = sessionId->getId(); - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 26; - time.tm_hour = 16; - time.tm_min = 0; - time.tm_sec = 0; - parameters["from"] = &time; - time.tm_year = 104; // 2004 - time.tm_mon = 9; // October - time.tm_mday = 27; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["to"] = &time; - - result.clear(); - CPPUNIT_ASSERT(xmlRpcClient.execute("generatePlayReport", - parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - // check the returned values - CPPUNIT_ASSERT(result.size() == 0); - - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/RpcGeneratePlayReportTest.h b/src/products/scheduler/src/RpcGeneratePlayReportTest.h deleted file mode 100644 index 54c4a93b2..000000000 --- a/src/products/scheduler/src/RpcGeneratePlayReportTest.h +++ /dev/null @@ -1,126 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcGeneratePlayReportTest_h -#define RpcGeneratePlayReportTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the GeneratePlayReportMethod class. - * - * @see GeneratePlayReportMethod - */ -class RpcGeneratePlayReportTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcGeneratePlayReportTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(intervalTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Insert some entries into the play log to provide test data. - */ - void - insertEntries(void) throw (CPPUNIT_NS::Exception); - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Look at some intervals, and check them against the test data. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - intervalTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcGeneratePlayReportTest_h - diff --git a/src/products/scheduler/src/RpcGetSchedulerTimeTest.cxx b/src/products/scheduler/src/RpcGetSchedulerTimeTest.cxx deleted file mode 100644 index d7ee29f27..000000000 --- a/src/products/scheduler/src/RpcGetSchedulerTimeTest.cxx +++ /dev/null @@ -1,131 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" - -#include "RpcGetSchedulerTimeTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcGetSchedulerTimeTest); - -/** - * The name of the configuration file for the scheduler daemon. - */ -static const std::string configFileName = "etc/scheduler.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcGetSchedulerTimeTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcGetSchedulerTimeTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); -} - - -/*------------------------------------------------------------------------------ - * Test a simple query, resulting in an empty result set. - *----------------------------------------------------------------------------*/ -void -RpcGetSchedulerTimeTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpcValue parameters; - XmlRpcValue result; - struct tm time1, - time2; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - result.clear(); - xmlRpcClient.execute("getSchedulerTime", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("schedulerTime")); - time1 = result["schedulerTime"]; - - result.clear(); - xmlRpcClient.execute("getSchedulerTime", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("schedulerTime")); - time2 = result["schedulerTime"]; - - CPPUNIT_ASSERT(time1.tm_year == time2.tm_year); - // could fail on New Year's Eve, but we don't work on New Year's Eve - - CPPUNIT_ASSERT(time1.tm_hour <= time2.tm_hour); - CPPUNIT_ASSERT(time1.tm_min <= time2.tm_min); - CPPUNIT_ASSERT(time1.tm_min + 1 >= time2.tm_min); - - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/RpcGetSchedulerTimeTest.h b/src/products/scheduler/src/RpcGetSchedulerTimeTest.h deleted file mode 100644 index bb769b604..000000000 --- a/src/products/scheduler/src/RpcGetSchedulerTimeTest.h +++ /dev/null @@ -1,101 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcGetSchedulerTimeTest_h -#define RpcGetSchedulerTimeTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the getSchedulerTime XML-RPC call. - * - * @see SchedulerDaemon - */ -class RpcGetSchedulerTimeTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcGetSchedulerTimeTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * Simple test for an empty query. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcGetSchedulerTimeTest_h - diff --git a/src/products/scheduler/src/RpcGetVersionTest.cxx b/src/products/scheduler/src/RpcGetVersionTest.cxx deleted file mode 100644 index bda4240e3..000000000 --- a/src/products/scheduler/src/RpcGetVersionTest.cxx +++ /dev/null @@ -1,101 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" - -#include "RpcGetVersionTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcGetVersionTest); - -/** - * The prefix of the persumed version string. - */ -static const std::string versionPrefix = "LiveSupport Scheduler Daemon"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcGetVersionTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcGetVersionTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); -} - - -/*------------------------------------------------------------------------------ - * Test a simple upload. - *----------------------------------------------------------------------------*/ -void -RpcGetVersionTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - result.clear(); - xmlRpcClient.execute("getVersion", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - CPPUNIT_ASSERT(result.hasMember("version")); - std::string versionStr = result["version"]; - CPPUNIT_ASSERT(versionStr.find(versionPrefix) == 0); - - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/RpcGetVersionTest.h b/src/products/scheduler/src/RpcGetVersionTest.h deleted file mode 100644 index aa0db30e9..000000000 --- a/src/products/scheduler/src/RpcGetVersionTest.h +++ /dev/null @@ -1,99 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcGetVersionTest_h -#define RpcGetVersionTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the getVersion XML-RPC call. - * - * @see SchedulerDaemon - */ -class RpcGetVersionTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcGetVersionTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST_SUITE_END(); - - protected: - - /** - * Simple test for playlist uploading. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcGetVersionTest_h - diff --git a/src/products/scheduler/src/RpcRemoveFromScheduleTest.cxx b/src/products/scheduler/src/RpcRemoveFromScheduleTest.cxx deleted file mode 100644 index 528d01eaf..000000000 --- a/src/products/scheduler/src/RpcRemoveFromScheduleTest.cxx +++ /dev/null @@ -1,235 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" -#include "LiveSupport/Core/TimeConversion.h" - -#include "RpcRemoveFromScheduleTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcRemoveFromScheduleTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcRemoveFromScheduleTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcRemoveFromScheduleTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A simple smoke test. - *----------------------------------------------------------------------------*/ -void -RpcRemoveFromScheduleTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpcValue parameters; - XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // first schedule a playlist, so that there is something to remove - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpcValue::TypeString); - Ptr::Ref entryId(new UniqueId(std::string( - result["scheduleEntryId"] ))); - parameters["scheduleEntryId"] = std::string(*entryId); - - result.clear(); - xmlRpcClient.execute("removeFromSchedule", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A simple negative test. - *----------------------------------------------------------------------------*/ -void -RpcRemoveFromScheduleTest :: negativeTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpcValue parameters; - XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = "0000000000009999"; - - result.clear(); - xmlRpcClient.execute("removeFromSchedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A test to try to remove a currently playing entry. - *----------------------------------------------------------------------------*/ -void -RpcRemoveFromScheduleTest :: currentlyPlayingTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpcValue parameters; - XmlRpcValue result; - Ptr::Ref now; - struct tm time; - Ptr::Ref duration; - Ptr::Ref entryId; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // first schedule (upload) a playlist, for 15 seconds from now - now = TimeConversion::now(); - *now += seconds(10); - TimeConversion::ptimeToTm(now, time); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpcValue::TypeString); - entryId.reset(new UniqueId(std::string(result["scheduleEntryId"] ))); - - // wait 10 seconds, so that what we've scheduled is the currently playing - // entry - duration.reset(new time_duration(seconds(10))); - TimeConversion::sleep(duration); - - // now try to remove what we've scheduled, this should fail - parameters["scheduleEntryId"] = std::string(*entryId); - - result.clear(); - xmlRpcClient.execute("removeFromSchedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} diff --git a/src/products/scheduler/src/RpcRemoveFromScheduleTest.h b/src/products/scheduler/src/RpcRemoveFromScheduleTest.h deleted file mode 100644 index 4d984bec1..000000000 --- a/src/products/scheduler/src/RpcRemoveFromScheduleTest.h +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcRemoveFromScheduleTest_h -#define RpcRemoveFromScheduleTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the removeFromSchedule XML-RPC call. - * - * @see SchedulerDaemon - */ -class RpcRemoveFromScheduleTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcRemoveFromScheduleTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(negativeTest); - CPPUNIT_TEST(currentlyPlayingTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - protected: - - /** - * Simple smoke test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Simple negative test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - negativeTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to see if removing the currently playing entry works - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - currentlyPlayingTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcRemoveFromScheduleTest_h - diff --git a/src/products/scheduler/src/RpcRescheduleTest.cxx b/src/products/scheduler/src/RpcRescheduleTest.cxx deleted file mode 100644 index 4fb255ecd..000000000 --- a/src/products/scheduler/src/RpcRescheduleTest.cxx +++ /dev/null @@ -1,290 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" -#include "LiveSupport/Core/TimeConversion.h" - -#include "RpcRescheduleTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcRescheduleTest); - -/** - * The name of the configuration file for the scheduler daemon. - */ -static const std::string configFileName = "etc/scheduler.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcRescheduleTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcRescheduleTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A simple smoke test. - *----------------------------------------------------------------------------*/ -void -RpcRescheduleTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // first schedule a playlist, so that there is something to reschedule - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpcValue::TypeString); - Ptr::Ref entryId(new UniqueId(std::string( - result["scheduleEntryId"] ))); - - // now reschedule it - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 8; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("reschedule", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - // now reschedule it unto itself, should fail - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 8; - time.tm_min = 30; - time.tm_sec = 0; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("reschedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A simple negative test. - *----------------------------------------------------------------------------*/ -void -RpcRescheduleTest :: negativeTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = "0000000000009999"; - - result.clear(); - xmlRpcClient.execute("removeFromSchedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A test to see if the currently playing entry can be rescheduled (should not) - *----------------------------------------------------------------------------*/ -void -RpcRescheduleTest :: currentlyPlayingTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - Ptr::Ref now; - struct tm time; - Ptr::Ref duration; - Ptr::Ref entryId; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // first schedule (upload) a playlist, for 10 seconds from now - now = TimeConversion::now(); - *now += seconds(10); - TimeConversion::ptimeToTm(now, time); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - CPPUNIT_ASSERT(result["scheduleEntryId"].getType() - == XmlRpcValue::TypeString); - entryId.reset(new UniqueId(std::string(result["scheduleEntryId"] ))); - - // wait 10 seconds, so that what we've scheduled is the currently playing - // entry - duration.reset(new time_duration(seconds(10))); - TimeConversion::sleep(duration); - - // now try to reschedule it, should faile - parameters["sessionId"] = sessionId->getId(); - parameters["scheduleEntryId"] = std::string(*entryId); - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 8; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("reschedule", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - diff --git a/src/products/scheduler/src/RpcRescheduleTest.h b/src/products/scheduler/src/RpcRescheduleTest.h deleted file mode 100644 index 4edc3c447..000000000 --- a/src/products/scheduler/src/RpcRescheduleTest.h +++ /dev/null @@ -1,130 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcRescheduleTest_h -#define RpcRescheduleTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the removeFromSchedule XML-RPC call. - * - * @see SchedulerDaemon - */ -class RpcRescheduleTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcRescheduleTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(negativeTest); - CPPUNIT_TEST(currentlyPlayingTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - protected: - - /** - * Simple smoke test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Simple negative test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - negativeTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to see if the currently playing entry can be reschuled - * (should not) - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - currentlyPlayingTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcRescheduleTest_h - diff --git a/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.cxx b/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.cxx deleted file mode 100644 index aea3a92c6..000000000 --- a/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.cxx +++ /dev/null @@ -1,237 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision$ - Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/branches/scheduler_export/livesupport/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.cxx $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" -#include "LiveSupport/Core/TimeConversion.h" - -#include "RpcStopCurrentlyPlayingTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcStopCurrentlyPlayingTest); - -/** - * The name of the configuration file for the scheduler daemon. - */ -static const std::string configFileName = "etc/scheduler.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcStopCurrentlyPlayingTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcStopCurrentlyPlayingTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A simple smoke test. - *----------------------------------------------------------------------------*/ -void -RpcStopCurrentlyPlayingTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - schedulePlaylistToPlayNow(); - - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - CPPUNIT_ASSERT(daemon); - Ptr::Ref audioPlayer = daemon->getAudioPlayer(); - CPPUNIT_ASSERT(audioPlayer); - - sleep(10); - CPPUNIT_ASSERT(audioPlayer->isOpen()); - CPPUNIT_ASSERT(audioPlayer->isPlaying()); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // first schedule a playlist, so that there is something to reschedule - CPPUNIT_ASSERT(sessionId); - parameters["sessionId"] = sessionId->getId(); - - result.clear(); - xmlRpcClient.execute("stopCurrentlyPlaying", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); - - CPPUNIT_ASSERT(!audioPlayer->isPlaying()); - CPPUNIT_ASSERT(!audioPlayer->isOpen()); -} - - -/*------------------------------------------------------------------------------ - * A simple negative test. - *----------------------------------------------------------------------------*/ -void -RpcStopCurrentlyPlayingTest :: negativeTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(sessionId); - parameters["sessionId"] = sessionId->getId(); - - result.clear(); - xmlRpcClient.execute("stopCurrentlyPlaying", parameters, result); - CPPUNIT_ASSERT(xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Schedule a playlist to play now. - *----------------------------------------------------------------------------*/ -void -RpcStopCurrentlyPlayingTest :: schedulePlaylistToPlayNow(void) - throw (CPPUNIT_NS::Exception) -{ - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // try to schedule playlist #1 for the time in 5 seconds - parameters.clear(); - CPPUNIT_ASSERT(sessionId); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - Ptr::Ref now = TimeConversion::now(); - Ptr::Ref startTime(new ptime(*now + seconds(10))); - TimeConversion::ptimeToTm(startTime, time); - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.h b/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.h deleted file mode 100644 index e179bfa73..000000000 --- a/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.h +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision$ - Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/branches/scheduler_export/livesupport/src/products/scheduler/src/RpcStopCurrentlyPlayingTest.h $ - -------------------------------------------------------------------------------*/ -#ifndef RpcStopCurrentlyPlayingTest_h -#define RpcStopCurrentlyPlayingTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the removeFromSchedule XML-RPC call. - * - * @author $Author: fgerlits $ - * @version $Revision$ - * @see SchedulerDaemon - */ -class RpcStopCurrentlyPlayingTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcStopCurrentlyPlayingTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(negativeTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - /** - * Schedule a playlist, so we can stop it. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - schedulePlaylistToPlayNow(void) throw (CPPUNIT_NS::Exception); - - - protected: - - /** - * Simple smoke test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Simple negative test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - negativeTest(void) throw (CPPUNIT_NS::Exception); - - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcStopCurrentlyPlayingTest_h - diff --git a/src/products/scheduler/src/RpcUploadPlaylistTest.cxx b/src/products/scheduler/src/RpcUploadPlaylistTest.cxx deleted file mode 100644 index 55433b605..000000000 --- a/src/products/scheduler/src/RpcUploadPlaylistTest.cxx +++ /dev/null @@ -1,209 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#include -#include -#include - -#include "SchedulerDaemon.h" - -#include "RpcUploadPlaylistTest.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(RpcUploadPlaylistTest); - -/** - * The name of the configuration file for the scheduler daemon. - */ -static const std::string configFileName = "etc/scheduler.xml"; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -RpcUploadPlaylistTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - if (!daemon->isConfigured()) { - try { - Ptr::Ref parser(new xmlpp::DomParser( - configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - const xmlpp::Element * root = document->get_root_node(); - daemon->configure(*root); - } catch (std::invalid_argument &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - std::cerr << e.what() << std::endl; - CPPUNIT_FAIL("error parsing configuration file"); - } - } - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - CPPUNIT_ASSERT(xmlRpcClient.execute("resetStorage", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - parameters["login"] = "root"; - parameters["password"] = "q"; - CPPUNIT_ASSERT(xmlRpcClient.execute("login", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("sessionId")); - - xmlRpcClient.close(); - - sessionId.reset(new SessionId(std::string(result["sessionId"]))); -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -RpcUploadPlaylistTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - parameters["sessionId"] = sessionId->getId(); - CPPUNIT_ASSERT(xmlRpcClient.execute("logout", parameters, result)); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * Test a simple upload. - *----------------------------------------------------------------------------*/ -void -RpcUploadPlaylistTest :: simpleTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // try to schedule playlist #1 for the time below - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - - -/*------------------------------------------------------------------------------ - * A test to try to schedule something that would have to have - * been already initialized (thus, the start time is in the - * future, but the initialize time is already in the past.) - * see http://bugs.campware.org/view.php?id=757 - *----------------------------------------------------------------------------*/ -void -RpcUploadPlaylistTest :: postInitTest(void) - throw (CPPUNIT_NS::Exception) -{ - CPPUNIT_ASSERT(sessionId); - - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue result; - struct tm time; - - XmlRpc::XmlRpcClient xmlRpcClient(getXmlRpcHost().c_str(), - getXmlRpcPort(), - "/RPC2", - false); - - // first, get the scheduler time - result.clear(); - xmlRpcClient.execute("getSchedulerTime", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - CPPUNIT_ASSERT(result.hasMember("schedulerTime")); - time = result["schedulerTime"]; - - // try to schedule playlist #1 in 4 seconds from now - parameters.clear(); - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - // TODO: hopefully time conversion will handle seconds > 60 OK - time.tm_sec += 4; - parameters["playtime"] = &time; - - result.clear(); - xmlRpcClient.execute("uploadPlaylist", parameters, result); - CPPUNIT_ASSERT(!xmlRpcClient.isFault()); - - xmlRpcClient.close(); -} - diff --git a/src/products/scheduler/src/RpcUploadPlaylistTest.h b/src/products/scheduler/src/RpcUploadPlaylistTest.h deleted file mode 100644 index 425337ed3..000000000 --- a/src/products/scheduler/src/RpcUploadPlaylistTest.h +++ /dev/null @@ -1,123 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef RpcUploadPlaylistTest_h -#define RpcUploadPlaylistTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/SessionId.h" - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test to test the uploadPlaylist XML-RPC call. - * - * @see SchedulerDaemon - */ -class RpcUploadPlaylistTest : public BaseTestMethod -{ - CPPUNIT_TEST_SUITE(RpcUploadPlaylistTest); - CPPUNIT_TEST(simpleTest); - CPPUNIT_TEST(postInitTest); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - protected: - - /** - * Simple test for playlist uploading. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - simpleTest(void) throw (CPPUNIT_NS::Exception); - - /** - * A test to try to schedule something that would have to have - * been already initialized (thus, the start time is in the - * future, but the initialize time is already in the past.) - * see http://bugs.campware.org/view.php?id=757 - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - postInitTest(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // RpcUploadPlaylistTest_h - diff --git a/src/products/scheduler/src/ScheduleFactory.cxx b/src/products/scheduler/src/ScheduleFactory.cxx deleted file mode 100644 index 1bad1a32d..000000000 --- a/src/products/scheduler/src/ScheduleFactory.cxx +++ /dev/null @@ -1,109 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "PostgresqlSchedule.h" -#include "ScheduleFactory.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string ScheduleFactory::configElementNameStr = - "scheduleFactory"; - -/*------------------------------------------------------------------------------ - * The singleton instance of Scheduleactory - *----------------------------------------------------------------------------*/ -Ptr::Ref ScheduleFactory::singleton; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instance to ScheduleFactory - *----------------------------------------------------------------------------*/ -Ptr::Ref -ScheduleFactory :: getInstance(void) throw () -{ - if (!singleton.get()) { - singleton.reset(new ScheduleFactory()); - } - - return singleton; -} - - -/*------------------------------------------------------------------------------ - * Configure the schedule factory. - *----------------------------------------------------------------------------*/ -void -ScheduleFactory :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - schedule.reset(); - - Ptr::Ref cmf = - ConnectionManagerFactory::getInstance(); - Ptr::Ref cm = cmf->getConnectionManager(); - - // try to look for a PostgresqlSchedule configuration element - xmlpp::Node::NodeList nodes = - element.get_children(PostgresqlSchedule::getConfigElementName()); - if (nodes.size() >= 1) { - const xmlpp::Element * configElement = - dynamic_cast (*(nodes.begin())); - Ptr::Ref dbs(new PostgresqlSchedule(cm)); - dbs->configure(*configElement); - schedule = dbs; - } - - if (!schedule) { - throw std::invalid_argument("no storage client factories to configure"); - } -} diff --git a/src/products/scheduler/src/ScheduleFactory.h b/src/products/scheduler/src/ScheduleFactory.h deleted file mode 100644 index 64776ea91..000000000 --- a/src/products/scheduler/src/ScheduleFactory.h +++ /dev/null @@ -1,176 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ScheduleFactory_h -#define ScheduleFactory_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Core/Configurable.h" -#include "ScheduleInterface.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The factory to create appropriate Schedule objects. - * - * This object has to be configured with an element that contains - * the configuration element that the factory should build. - * Currently only PostgresqlSchedule is supported by this factory. - * - * An example configuration element is the following: - * - *

- *      <scheduleFactory>
- *          <postgresqlSchedule/>
- *      </scheduleFactory>
- *  
- * - * The DTD for the above element is: - * - *

- *  <!ELEMENT scheduleFactory (postgresqlSchedule) >
- *  
- * - * For details on the <postgreslSchedule> element, see the - * PostgresqlSchedule documentation. - * - * @see PostgresqlSchedule - */ -class ScheduleFactory : virtual public Configurable -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The singleton instance of this object. - */ - static Ptr::Ref singleton; - - /** - * The schedule created by this factory. - */ - Ptr::Ref schedule; - - /** - * The default constructor. - */ - ScheduleFactory(void) throw() - { - } - - - public: - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~ScheduleFactory(void) throw () - { - } - - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Returns the singleton instance of this object. - * - * @return the singleton instance of this object. - */ - static Ptr::Ref - getInstance() throw (); - - /** - * Configure the object based on the XML element supplied. - * - * @param element the XML element to configure the object from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the object has already - * been configured, and can not be reconfigured. - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Return a schedule. - * - * @return the appropriate schedule, according to the - * configuration of this factory. - */ - Ptr::Ref - getSchedule(void) throw () - { - return schedule; - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Storage -} // namespace LiveSupport - -#endif // ScheduleFactory_h - diff --git a/src/products/scheduler/src/ScheduleInterface.h b/src/products/scheduler/src/ScheduleInterface.h deleted file mode 100644 index 5089cf13c..000000000 --- a/src/products/scheduler/src/ScheduleInterface.h +++ /dev/null @@ -1,257 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef ScheduleInterface_h -#define ScheduleInterface_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Playlist.h" -#include "LiveSupport/Core/ScheduleEntry.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; - - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * The generic interface for the component scheduling events. - * - */ -class ScheduleInterface -{ - public: - /** - * A vector of ScheduleEntry objects. - */ - typedef std::vector::Ref> ScheduleEntryList; - - - /** - * Check if a timeframe is available for scheduling. - * - * @param from the start time of the timeframe. - * @param to the end time of the timeframe. - * @return true if the timeframe is available, false otherwise. - */ - virtual bool - isTimeframeAvailable(Ptr::Ref from, - Ptr::Ref to) throw () - = 0; - - /** - * Schedule a playlist. - * - * @param playlist the playlist to schedule. - * @param playtime the time to schedule the playlist for. - * @return the id of the newly created playlist. - * @exception std::invalid_argument if there is something - * already scheduled for the duration of the playlist. - */ - virtual Ptr::Ref - schedulePlaylist(Ptr::Ref playlist, - Ptr::Ref playtime) - throw (std::invalid_argument) - = 0; - - /** - * Return the list of scheduled entries for a specified time interval. - * It returns all entries which intersect the interval (i.e., start - * before toTime, and end later than fromTime). - * - * @param fromTime the start of the time of the interval queried - * @param toTime to end of the time of the interval queried - * @return a vector of the scheduled entries for the time region. - */ - virtual Ptr::Ref - getScheduleEntries(Ptr::Ref fromTime, - Ptr::Ref toTime) - throw () - = 0; - - /** - * Export schedule entries to a DOM tree. - * - * @param element a new DOM element will be added as a child to - * this element, which will contain the export. - * @param fromTime entries are included in the export starting - * from this time. - * @param toTime entries as included in the export up to - * but not including this time. - * @return a DOM element, which is the export. - * it is the responsibility of the caller to free up the - * returned element. - * @see #importScheduleEntries - */ - virtual void - exportScheduleEntries(xmlpp::Element * element, - Ptr::Ref fromTime, - Ptr::Ref toTime) - throw () = 0; - - /** - * Import schedule entries from a DOM tree. - * - * @param domTree the DOM tree containing schedule entries, to import. - * @exception std::invalid_argument if the supplied DOM tree - * is not valid. - * @see #exportScheduleEntries - */ - virtual void - importScheduleEntries(const xmlpp::Element * domTree) - throw (std::invalid_argument) - = 0; - - /** - * Return the schedule entry that is being played at the moment. - * - * @return the schedule entry that is being played at the monent, - * or a reference to null, if nothing is playing currently. - */ - virtual Ptr::Ref - getCurrentlyPlaying(void) throw () - = 0; - - /** - * Return the next schedule entry, after (but not including) - * the specified timepoint. - * - * @param fromTime the start of the time of the interval queried, - * inclusive - * @return the first schedule entry, after the specified timepoint. - */ - virtual Ptr::Ref - getNextEntry(Ptr::Ref fromTime) - throw () - = 0; - - /** - * Return the current schedule entry. - * - * - * @param - * - * @return the current schedule entry - */ - virtual Ptr::Ref - getCurrentEntry() - throw () - = 0; - - /** - * Tell if a schedule entry exists by the give name. - * - * @param entryId the id of the schedule entry to check for. - * @return true if the schedule entry exists in the Schedule, - * false otherwise. - */ - virtual bool - scheduleEntryExists(Ptr::Ref entryId) - throw () - = 0; - - /** - * Remove a schedule entry from the schedule. - * - * @param entryId the id of the schedule to remove. - * @exception std::invalid_argument if no schedule with the specified - * id exists. - */ - virtual void - removeFromSchedule(Ptr::Ref entryId) - throw (std::invalid_argument) - = 0; - - /** - * Return a schedule entry for a specified id. - * - * @param entryId the id of the entry to get. - * @return the ScheduleEntry for the specified id. - * @exception std::invalid_argument if no entry by the specified - * id exists. - */ - virtual Ptr::Ref - getScheduleEntry(Ptr::Ref entryId) - throw (std::invalid_argument) - = 0; - - /** - * Reschedule an event to a different time. - * - * @param entryId the id of the entry to reschedule. - * @param playtime the new time for the schedule. - * @exception std::invalid_argument if there is something already - * scheduled for the new duration. - */ - virtual void - reschedule(Ptr::Ref entryId, - Ptr::Ref playtime) - throw (std::invalid_argument) - = 0; - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~ScheduleInterface(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // ScheduleInterface_h - diff --git a/src/products/scheduler/src/SchedulerDaemon.cxx b/src/products/scheduler/src/SchedulerDaemon.cxx deleted file mode 100644 index ecce5e6fd..000000000 --- a/src/products/scheduler/src/SchedulerDaemon.cxx +++ /dev/null @@ -1,365 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_SIGNAL_H -#include -#else -#error "Need signal.h" -#endif - -#if HAVE_SYS_STAT_H -#include -#else -#error "Need sys/stat.h" -#endif - - -#include -#include -#include -#include - -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerFactory.h" -#include "ScheduleFactory.h" -#include "PlayLogFactory.h" -#include "BackupFactory.h" -#include "PlaylistEventContainer.h" - -#include "SchedulerDaemon.h" - -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * The singleton instance of the Scheduler daemon object. - */ -Ptr::Ref SchedulerDaemon::schedulerDaemon; - -namespace { - -/** - * The name of the XML configuration element for the Scheduler daemon. - */ -const std::string confElement = "scheduler"; - -/** - * The name of the XML configuration element for the XmlRpcDaemon inside. - */ -const std::string xmlRpcDaemonConfElement = "xmlRpcDaemon"; - -/** - * The name of the config child element for the login and password - */ -const std::string userConfigElementName = "user"; - -/** - * The name of the config element attribute for the login - */ -const std::string userLoginAttrName = "login"; - -/** - * The name of the config element attribute for the password - */ -const std::string userPasswordAttrName = "password"; - -} - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * The default constructor. - *----------------------------------------------------------------------------*/ -SchedulerDaemon :: SchedulerDaemon (void) throw () - : XmlRpcDaemon() -{ - displayScheduleMethod.reset(new DisplayScheduleMethod()); - generatePlayReportMethod.reset(new GeneratePlayReportMethod()); - getSchedulerTimeMethod.reset(new GetSchedulerTimeMethod()); - getVersionMethod.reset(new GetVersionMethod()); - removeFromScheduleMethod.reset(new RemoveFromScheduleMethod()); - rescheduleMethod.reset(new RescheduleMethod()); - uploadPlaylistMethod.reset(new UploadPlaylistMethod()); - loginMethod.reset(new LoginMethod()); - logoutMethod.reset(new LogoutMethod()); - resetStorageMethod.reset(new ResetStorageMethod()); - createBackupOpenMethod.reset(new CreateBackupOpenMethod()); - createBackupCheckMethod.reset(new CreateBackupCheckMethod()); - createBackupCloseMethod.reset(new CreateBackupCloseMethod()); - restoreBackupMethod.reset(new RestoreBackupMethod()); - stopCurrentlyPlayingMethod.reset(new StopCurrentlyPlayingMethod()); -} - - -/*------------------------------------------------------------------------------ - * Return the singleton instnace. - *----------------------------------------------------------------------------*/ -Ptr::Ref -SchedulerDaemon :: getInstance (void) throw () -{ - if (!schedulerDaemon) { - schedulerDaemon.reset(new SchedulerDaemon()); - } - - return schedulerDaemon; -} - - -/*------------------------------------------------------------------------------ - * Configure the scheduler daemon - *----------------------------------------------------------------------------*/ -void -SchedulerDaemon :: configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (element.get_name() != confElement) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - xmlpp::Node::NodeList nodes; - const xmlpp::Element * elem = 0; - const xmlpp::Attribute * attribute = 0; - - // read in the user data - - nodes = element.get_children(userConfigElementName); - if (nodes.size() < 1) { - throw std::invalid_argument("no user element"); - } - elem = dynamic_cast (*nodes.begin()); - if (!(attribute = elem->get_attribute(userLoginAttrName))) { - throw std::invalid_argument("missing login attribute"); - } - login = attribute->get_value(); - if (!(attribute = elem->get_attribute(userPasswordAttrName))) { - throw std::invalid_argument("missing password attribute"); - } - password = attribute->get_value(); - - // configure the ConnectionManagerFactory - nodes = - element.get_children(ConnectionManagerFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no connectionManagerFactory element"); - } - Ptr::Ref cmf - = ConnectionManagerFactory::getInstance(); - cmf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the AuthenticationClientFactory - nodes = - element.get_children(AuthenticationClientFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no authenticationClientFactory element"); - } - Ptr::Ref acf - = AuthenticationClientFactory::getInstance(); - acf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the StorageClientFactory - nodes = element.get_children(StorageClientFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no storageClientFactory element"); - } - Ptr::Ref scf = StorageClientFactory::getInstance(); - scf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the AudioPlayerFactory - nodes = element.get_children(AudioPlayerFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no audioPlayer element"); - } - Ptr::Ref apf = AudioPlayerFactory::getInstance(); - apf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the ScheduleFactory - nodes = element.get_children(ScheduleFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no scheduleFactory element"); - } - Ptr::Ref sf = ScheduleFactory::getInstance(); - sf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the PlayLogFactory - nodes = element.get_children(PlayLogFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no playLogFactory element"); - } - Ptr::Ref plf = PlayLogFactory::getInstance(); - plf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the BackupFactory - nodes = element.get_children(BackupFactory::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no backupFactory element"); - } - Ptr::Ref bf = BackupFactory::getInstance(); - bf->configure( *((const xmlpp::Element*) *(nodes.begin())) ); - - // configure the XmlRpcDaemon - nodes = element.get_children(XmlRpcDaemon::getConfigElementName()); - if (nodes.size() < 1) { - throw std::invalid_argument("no xmlRpcDaemon element"); - } - configureXmlRpcDaemon( *((const xmlpp::Element*) *(nodes.begin())) ); - - // do some initialization, using the configured objects - authentication = acf->getAuthenticationClient(); - connectionManager = cmf->getConnectionManager(); - storage = scf->getStorageClient(); - audioPlayer = apf->getAudioPlayer(); - schedule = sf->getSchedule(); - playLog = plf->getPlayLog(); -} - - -/*------------------------------------------------------------------------------ - * Destructor. - *----------------------------------------------------------------------------*/ -SchedulerDaemon :: ~SchedulerDaemon(void) throw () -{ - if (authentication.get() && sessionId.get()) { - authentication->logout(sessionId); - } -} - - -/*------------------------------------------------------------------------------ - * Register our XML-RPC methods - *----------------------------------------------------------------------------*/ -void -SchedulerDaemon :: registerXmlRpcFunctions( - Ptr::Ref xmlRpcServer) - throw (std::logic_error) -{ - xmlRpcServer->addMethod(displayScheduleMethod.get()); - xmlRpcServer->addMethod(generatePlayReportMethod.get()); - xmlRpcServer->addMethod(getSchedulerTimeMethod.get()); - xmlRpcServer->addMethod(getVersionMethod.get()); - xmlRpcServer->addMethod(removeFromScheduleMethod.get()); - xmlRpcServer->addMethod(rescheduleMethod.get()); - xmlRpcServer->addMethod(uploadPlaylistMethod.get()); - xmlRpcServer->addMethod(loginMethod.get()); - xmlRpcServer->addMethod(logoutMethod.get()); - xmlRpcServer->addMethod(resetStorageMethod.get()); - xmlRpcServer->addMethod(createBackupOpenMethod.get()); - xmlRpcServer->addMethod(createBackupCheckMethod.get()); - xmlRpcServer->addMethod(createBackupCloseMethod.get()); - xmlRpcServer->addMethod(restoreBackupMethod.get()); - xmlRpcServer->addMethod(stopCurrentlyPlayingMethod.get()); -} - - -/*------------------------------------------------------------------------------ - * Execute daemon startup functions. - *----------------------------------------------------------------------------*/ -void -SchedulerDaemon :: startup (void) throw (std::logic_error) -{ - try { - sessionId = authentication->login(login, password); - } catch (XmlRpcException &e) { - throw std::logic_error(std::string("authentication problem: ") - + e.what()); - } - - try { - audioPlayer->initialize(); - } catch (std::exception &e) { - throw std::logic_error(std::string("audio player initialization " - "problem: ") + e.what()); - } - if (!eventScheduler.get()) { - Ptr::Ref eventContainer; - Ptr::Ref granularity; - eventContainer.reset(new PlaylistEventContainer(sessionId, - storage, - schedule, - audioPlayer, - playLog)); - // TODO: read granularity from config file - granularity.reset(new time_duration(seconds(1))); - - eventScheduler.reset( - new LiveSupport::EventScheduler::EventScheduler(eventContainer, - granularity)); - } - eventScheduler->start(); - - XmlRpcDaemon::startup(); -} - - -/*------------------------------------------------------------------------------ - * Shut down the daemon - *----------------------------------------------------------------------------*/ -void -SchedulerDaemon :: shutdown(void) throw (std::logic_error) -{ - if (eventScheduler.get()) { - eventScheduler->stop(); - } - audioPlayer->deInitialize(); - - XmlRpcDaemon::shutdown(); -} - - -/*------------------------------------------------------------------------------ - * Re-read the events from the event container. - *----------------------------------------------------------------------------*/ -void -SchedulerDaemon :: update (void) throw (std::logic_error) -{ - // TODO: check if we've been configured - if (eventScheduler.get()) { - eventScheduler->update(); - } -} - diff --git a/src/products/scheduler/src/SchedulerDaemon.h b/src/products/scheduler/src/SchedulerDaemon.h deleted file mode 100644 index 128565cab..000000000 --- a/src/products/scheduler/src/SchedulerDaemon.h +++ /dev/null @@ -1,465 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SchedulerDaemon_h -#define SchedulerDaemon_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_SYS_TYPES_H -#include -#else -#error "Need sys/types.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/Configurable.h" -#include "LiveSupport/Core/SessionId.h" -#include "LiveSupport/Db/ConnectionManagerInterface.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "LiveSupport/EventScheduler/EventScheduler.h" -#include "PlayLogInterface.h" - -#include "DisplayScheduleMethod.h" -#include "GeneratePlayReportMethod.h" -#include "GetSchedulerTimeMethod.h" -#include "GetVersionMethod.h" -#include "RemoveFromScheduleMethod.h" -#include "RescheduleMethod.h" -#include "ScheduleInterface.h" -#include "UploadPlaylistMethod.h" -#include "XmlRpcDaemon.h" -#include "LoginMethod.h" -#include "LogoutMethod.h" -#include "ResetStorageMethod.h" -#include "CreateBackupOpenMethod.h" -#include "CreateBackupCheckMethod.h" -#include "CreateBackupCloseMethod.h" -#include "RestoreBackupMethod.h" -#include "StopCurrentlyPlayingMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::PlaylistExecutor; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Scheduler daemon main class. - * This class is responsible for starting, running and stopping the - * Scheduler daemon. - * - * The SchedulerDaemon has to configured by an XML element called - * scheduler. This element contains configuration elements for the - * compontents used by the scheduler. The configuration file looks - * like the following: - * - *

- *  <scheduler>
- *      <user login="userid" password="pwd" />
- *      <connectionManagerFactory>
- *          ...
- *      </connectionManagerFactory>
- *      <authenticationClientFactory>
- *          ...
- *      </authenticationClientFactory>
- *      <storageClientFactory>
- *          ...
- *      </storageClientFactory>
- *      <scheduleFactory>
- *          ...
- *      </scheduleFactory>
- *      <playLogFactory>
- *          ...
- *      </playLogFactory>
- *      <backupFactory>
- *          ...
- *      </backupFactory>
- *      <xmlRpcDaemon>
- *          ...
- *      </xmlRpcDaemon>
- *  </scheduler>
- *  
- * - * The user element holds creditentials for accessing the storage, - * configured below. - * - * For details on the included elements, see the corresponding documentation - * for XmlRpcDaemon, StorageClientFactory, ConnectionManagerFactory - * ScheduleFactory and AuthenticationClientFactory. - * - * The DTD for the above element is the following: - * - *

- *  <!ELEMENT scheduler (user,
- *                       connectionManagerFactory,
- *                       authenticationClientFactory,
- *                       storageClientFactory,
- *                       scheduleFactory,
- *                       playLogFactory,
- *                       backupFactory,
- *                       audioPlayer,
- *                       xmlRpcDaemon) >
- *  
- * - * @see ConnectionManagerFactory - * @see AuthenticationClientFactory - * @see StorageClientFactory - * @see ScheduleFactory - * @see XmlRpcDaemon - */ -class SchedulerDaemon : public Configurable, - public XmlRpcDaemon -{ - private: - - /** - * A SQL statement to check if the database can be accessed. - */ - static const std::string check1Stmt; - - /** - * The singleton instance of the scheduler daemon. - */ - static Ptr::Ref schedulerDaemon; - - /** - * The authentication client. - */ - Ptr::Ref authentication; - - /** - * The connection manager used by the scheduler. - */ - Ptr::Ref connectionManager; - - /** - * The storage client. - */ - Ptr::Ref storage; - - /** - * The schedule used by the scheduler daemon. - */ - Ptr::Ref schedule; - - /** - * The session id for the scheduler user. - */ - Ptr::Ref sessionId; - - /** - * The event scheduler. - */ - Ptr::Ref - eventScheduler; - - /** - * The audio player. - */ - Ptr::Ref audioPlayer; - - /** - * The play logging facility. - */ - Ptr::Ref playLog; - - /** - * The displayScheduleMethod the daemon is providing. - */ - Ptr::Ref displayScheduleMethod; - - /** - * The generatePlayReportMethod the daemon is providing. - */ - Ptr::Ref generatePlayReportMethod; - - /** - * The getSchedulerTimeMethod the daemon is providing. - */ - Ptr::Ref getSchedulerTimeMethod; - - /** - * The getVersion the daemon is providing. - */ - Ptr::Ref getVersionMethod; - - /** - * The removeFromScheduleMethod the daemon is providing. - */ - Ptr::Ref removeFromScheduleMethod; - - /** - * The rescheduleMethod the daemon is providing. - */ - Ptr::Ref rescheduleMethod; - - /** - * The uploadPlaylistMethod the daemon is providing. - */ - Ptr::Ref uploadPlaylistMethod; - - /** - * The loginMethod the daemon is providing. - */ - Ptr::Ref loginMethod; - - /** - * The logoutMethod the daemon is providing. - */ - Ptr::Ref logoutMethod; - - /** - * The resetStorageMethod the daemon is providing. - */ - Ptr::Ref resetStorageMethod; - - /** - * The createBackupOpenMethod the daemon is providing. - */ - Ptr::Ref createBackupOpenMethod; - - /** - * The createBackupCheckMethod the daemon is providing. - */ - Ptr::Ref createBackupCheckMethod; - - /** - * The createBackupCloseMethod the daemon is providing. - */ - Ptr::Ref createBackupCloseMethod; - - /** - * The restoreBackupMethod the daemon is providing. - */ - Ptr::Ref restoreBackupMethod; - - /** - * The stopCurrentlyPlayingMethod the daemon is providing. - */ - Ptr::Ref stopCurrentlyPlayingMethod; - - /** - * The login to the authentication system. - */ - std::string login; - - /** - * The password to the authentication system. - */ - std::string password; - - /** - * Default constructor. - */ - SchedulerDaemon (void) throw (); - - - protected: - - /** - * Register your XML-RPC functions by implementing this function. - */ - virtual void - registerXmlRpcFunctions(Ptr::Ref xmlRpcServer) - throw (std::logic_error); - - /** - * Execute any calls when the daemon is starting up. - * All resources allocated here should be freed up in shutdown(). - * - * @exception std::logic_error if startup could not succeed. - * @see #shutdown - */ - virtual void - startup (void) throw (std::logic_error); - - - public: - - /** - * Virtual destructor. - */ - virtual - ~SchedulerDaemon(void) throw (); - - /** - * Return a pointer to the singleton instance of SchedulerDaemon. - * - * @return a pointer to the singleton instance of SchedulerDaemon - */ - static Ptr::Ref - getInstance (void) throw (); - - /** - * Configure the scheduler daemon based on the XML element - * supplied. - * - * @param element the XML element to configure the scheduler - * daemon from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the scheduler daemon has already - * been configured. - */ - void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - /** - * Return the connection manager used by the scheduler. - * - * @return the connection manager used by the scheduler. - */ - Ptr::Ref - getConnectionManager(void) throw () - { - return connectionManager; - } - - /** - * Return the storage client used by the scheduler. - * - * @return the storage client used by the scheduler. - */ - Ptr::Ref - getStorage(void) throw () - { - return storage; - } - - /** - * Return the authentication client used by the scheduler. - * - * @return the authentication client used by the scheduler. - */ - Ptr::Ref - getAuthentication(void) throw () - { - return authentication; - } - - /** - * Return the schedule used by the scheduler. - * - * @return the schedule used by the scheduler. - */ - Ptr::Ref - getSchedule(void) throw () - { - return schedule; - } - - /** - * Return the play log used by the scheduler. - * - * @return the play log used by the scheduler. - */ - Ptr::Ref - getPlayLog(void) throw () - { - return playLog; - } - - /** - * Return the audio player used by the scheduler. - * - * @return the audio player used by the scheduler. - */ - Ptr::Ref - getAudioPlayer(void) throw () - { - return audioPlayer; - } - - /** - * Shut down the daemon. - * This function is public only because the signal handler - * needs visibility to this function, which will call it. - * A call to stop() will trigger a signal that will call shutdown(). - * - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - virtual void - shutdown (void) throw (std::logic_error); - - /** - * Re-read the scheduled events. - * Call this when the events in the schedule under the event container - * have changed. - * - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - virtual void - update(void) throw (std::logic_error); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // SchedulerDaemon_h - diff --git a/src/products/scheduler/src/SchedulerDaemonTest.cxx b/src/products/scheduler/src/SchedulerDaemonTest.cxx deleted file mode 100644 index 72b774fd4..000000000 --- a/src/products/scheduler/src/SchedulerDaemonTest.cxx +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include - -#include "SchedulerDaemon.h" -#include "SchedulerDaemonTest.h" - - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(SchedulerDaemonTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -SchedulerDaemonTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = daemon->getStorage(); - storage->reset(); - - } catch (std::invalid_argument &e) { - CPPUNIT_FAIL("semantic error in configuration file"); - } catch (xmlpp::exception &e) { - CPPUNIT_FAIL("error parsing configuration file"); - } catch (std::exception &e) { - CPPUNIT_FAIL(e.what()); - } - - authentication = daemon->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::string eMsg = "could not log in:\n"; - eMsg += e.what(); - CPPUNIT_FAIL(eMsg); - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -SchedulerDaemonTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Test to see if the singleton Hello object is accessible - *----------------------------------------------------------------------------*/ -void -SchedulerDaemonTest :: getSingleton(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT( daemon.get() ); -} - - -/*------------------------------------------------------------------------------ - * Test to see if the scheduler starts and stops OK - *----------------------------------------------------------------------------*/ -void -SchedulerDaemonTest :: testStartStop(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - CPPUNIT_ASSERT( daemon.get() ); - CPPUNIT_ASSERT( !(daemon->isRunning()) ); - daemon->start(); - sleep(3); - CPPUNIT_ASSERT( daemon->isRunning() ); - daemon->stop(); - sleep(3); - CPPUNIT_ASSERT( !(daemon->isRunning()) ); -} - diff --git a/src/products/scheduler/src/SchedulerDaemonTest.h b/src/products/scheduler/src/SchedulerDaemonTest.h deleted file mode 100644 index 00f1e2578..000000000 --- a/src/products/scheduler/src/SchedulerDaemonTest.h +++ /dev/null @@ -1,123 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SchedulerDaemonTest_h -#define SchedulerDaemonTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the SchedulerDaemon class. - * - * @see SchedulerDaemon - */ -class SchedulerDaemonTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(SchedulerDaemonTest); - CPPUNIT_TEST(getSingleton); - //CPPUNIT_TEST(testStartStop); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - - protected: - - /** - * A simple test to see if the singleton Hello object is accessible. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - getSingleton(void) throw (CPPUNIT_NS::Exception); - - /** - * Test to see if the daemon starts an stops OK. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - testStartStop(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // SchedulerDaemonTest_h - diff --git a/src/products/scheduler/src/SignalDispatcher.cxx b/src/products/scheduler/src/SignalDispatcher.cxx deleted file mode 100644 index 181ff4105..000000000 --- a/src/products/scheduler/src/SignalDispatcher.cxx +++ /dev/null @@ -1,137 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_SIGNAL_H -#include -#else -#error "Need signal.h" -#endif - -#if HAVE_SYS_STAT_H -#include -#else -#error "Need sys/stat.h" -#endif - - -#include -#include -#include -#include - -#include "SignalDispatcher.h" - - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The singleton isntnace of SignalDispatcher. - *----------------------------------------------------------------------------*/ -SignalDispatcher * SignalDispatcher::instance = 0; - -/*------------------------------------------------------------------------------ - * The signal handlers. - *----------------------------------------------------------------------------*/ -SignalHandler * SignalDispatcher::handlers[NSIG]; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Return the singleton instnace. - *----------------------------------------------------------------------------*/ -class SignalDispatcher * -SignalDispatcher :: getInstance (void) throw () -{ - if (!instance) { - instance = new SignalDispatcher(); - } - - return instance; -} - - -/*------------------------------------------------------------------------------ - * Register a signal handler - *----------------------------------------------------------------------------*/ -void -SignalDispatcher :: registerHandler( - int signal, - SignalHandler * signalHandler) - throw (std::invalid_argument) -{ - if (signal < 0 || signal >= NSIG) { - throw std::invalid_argument("invalid signal value"); - } - if (!signalHandler) { - throw std::invalid_argument("signalHandler is 0"); - } - - handlers[signal] = signalHandler; - - // register our dispatcher for this signal - ::signal(signal, dispatcher); -} - - -/*------------------------------------------------------------------------------ - * Remove a signal handler - *----------------------------------------------------------------------------*/ -void -SignalDispatcher :: removeHandler( - int signal) - throw (std::invalid_argument) -{ - if (signal < 0 || signal >= NSIG) { - throw std::invalid_argument("invalid signal value"); - } - - handlers[signal] = 0; - - ::signal(signal, SIG_DFL); -} - - -/*------------------------------------------------------------------------------ - * Our signal dispatcher - *----------------------------------------------------------------------------*/ -void -SignalDispatcher :: dispatcher(int signal) throw () -{ - handlers[signal]->handleSignal(signal); -} - diff --git a/src/products/scheduler/src/SignalDispatcher.h b/src/products/scheduler/src/SignalDispatcher.h deleted file mode 100644 index 47ac70efd..000000000 --- a/src/products/scheduler/src/SignalDispatcher.h +++ /dev/null @@ -1,140 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SignalDispatcher_h -#define SignalDispatcher_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_SIGNAL_H -#include -#else -#error "Need signal.h" -#endif - -#include -#include - -#include "SignalHandler.h" - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A class to dispatch signals. - * See http://www.cs.wustl.edu/~schmidt/signal-patterns.html for details. - * - */ -class SignalDispatcher -{ - private: - - /** - * The singleton instance of this class. - */ - static SignalDispatcher * instance; - - /** - * An array of registered signal handlers, - * of size NSIG defined in signal.h - */ - static SignalHandler * handlers[NSIG]; - - /** - * Default constructor. - */ - SignalDispatcher(void) throw () - { - } - - /** - * The function registered to handle signals. - * - * @param signal the signal being handled. - */ - static void - dispatcher(int signal) throw (); - - public: - - /** - * Return the singleton instance of SignalDispatcher. - * - * @return the singleton instance of SignalDispatcher. - */ - static SignalDispatcher * - getInstance(void) throw (); - - /** - * Register a signal handler for a specific signal. - * - * @param signal the signal to register for. - * @param signalHandler the signal handler to register. - * @exception std::invalid_argument if signal is out of range, - * or if signalHandler is 0. - */ - void - registerHandler(int signal, - SignalHandler * signalHandler) - throw (std::invalid_argument); - - /** - * Remove a signal handler for a specific signal. - * Restores the original system signal handling. - * - * @param signal the signal to remove the handler for. - * @exception std::invalid_argument if signal is out of range. - */ - void - removeHandler(int signal) throw (std::invalid_argument); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // SignalDispatcher_h - diff --git a/src/products/scheduler/src/SignalHandler.h b/src/products/scheduler/src/SignalHandler.h deleted file mode 100644 index 9fbda2601..000000000 --- a/src/products/scheduler/src/SignalHandler.h +++ /dev/null @@ -1,87 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef SignalHandler_h -#define SignalHandler_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A class to handle a signal. - * Register subclasses of this class at SignalDispatcher. - * See http://www.cs.wustl.edu/~schmidt/signal-patterns.html for details. - * - * @see SignalDispatcher - */ -class SignalHandler -{ - public: - /** - * Handle the signal. - * - * @param signal the actual signal received. - */ - virtual void - handleSignal(int signal) throw () = 0; - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~SignalHandler(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // SignalHandler_h - diff --git a/src/products/scheduler/src/StopCurrentlyPlayingMethod.cxx b/src/products/scheduler/src/StopCurrentlyPlayingMethod.cxx deleted file mode 100644 index b38ef4a29..000000000 --- a/src/products/scheduler/src/StopCurrentlyPlayingMethod.cxx +++ /dev/null @@ -1,151 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision$ - Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/trunk/livesupport/src/products/scheduler/src/StopCurrentlyPlayingMethod.cxx $ - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include -#include - -#include "LiveSupport/PlaylistExecutor/AudioPlayerInterface.h" -#include "LiveSupport/Core/XmlRpcTools.h" -#include "SchedulerDaemon.h" -#include "ScheduleInterface.h" -#include "ScheduleFactory.h" - -#include "StopCurrentlyPlayingMethod.h" - - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string StopCurrentlyPlayingMethod::methodName - = "stopCurrentlyPlaying"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int StopCurrentlyPlayingMethod::errorId = 5000; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -StopCurrentlyPlayingMethod :: StopCurrentlyPlayingMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the remove from schedule XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -StopCurrentlyPlayingMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, - "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - // TODO: check the session ID - - Ptr::Ref sd = SchedulerDaemon::getInstance(); - Ptr::Ref sf = ScheduleFactory::getInstance(); - Ptr::Ref schedule = sf->getSchedule(); - Ptr::Ref currentlyPlaying; - - // remove the item from the schedule, so something else can be scheduled - try { - currentlyPlaying = schedule->getCurrentlyPlaying(); - if (currentlyPlaying) { - schedule->removeFromSchedule(currentlyPlaying->getId()); - - // tell the scheduler daemon to reload the scheduled events - sd->update(); - } - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "schedule entry not found", - returnValue); - return; - } - - // stop the audio player - Ptr::Ref audioPlayer = sd->getAudioPlayer(); - - try { - audioPlayer->stop(); - audioPlayer->close(); - - } catch (std::logic_error &e) { - XmlRpcTools::markError(errorId+10, e.what(), returnValue); - return; - } -} - diff --git a/src/products/scheduler/src/StopCurrentlyPlayingMethod.h b/src/products/scheduler/src/StopCurrentlyPlayingMethod.h deleted file mode 100644 index e9226bd09..000000000 --- a/src/products/scheduler/src/StopCurrentlyPlayingMethod.h +++ /dev/null @@ -1,150 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - To report bugs, send an e-mail to bugs@campware.org - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - Author : $Author: fgerlits $ - Version : $Revision$ - Location : $URL: svn+ssh://fgerlits@code.campware.org/home/svn/repo/livesupport/trunk/livesupport/src/products/scheduler/src/StopCurrentlyPlayingMethod.h $ - -------------------------------------------------------------------------------*/ -#ifndef StopCurrentlyPlayingMethod_h -#define StopCurrentlyPlayingMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to stop the scheduler's audio player. - * - * The name of the method when called through XML-RPC is - * "stopCurrentlyPlaying". - * - * Stops the audio player, and removes the current item from the schedule, - * so that something else can be scheduled in its place. - * - * The expected parameter is an XML-RPC structure, with the following - * member: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 5001 - invalid argument format
  • - *
  • 5010 - error reported by the audio player component
  • - *
  • 5020 - missing session ID argument
  • - *
- * - * @author $Author: fgerlits $ - * @version $Revision$ - */ -class StopCurrentlyPlayingMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - StopCurrentlyPlayingMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - StopCurrentlyPlayingMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the remove from schedule command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute(XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // StopCurrentlyPlayingMethod_h - diff --git a/src/products/scheduler/src/TestRunner.cxx b/src/products/scheduler/src/TestRunner.cxx deleted file mode 100644 index 6643be741..000000000 --- a/src/products/scheduler/src/TestRunner.cxx +++ /dev/null @@ -1,304 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "BaseTestMethod.h" - - -using namespace LiveSupport::Core; -using namespace LiveSupport::Scheduler; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * Our copyright notice, should be at most 80 columns - */ -static const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -static const char options[] = "c:ho:s:v"; - -/** - * Structure describing the long options - */ -static const struct option longOptions[] = { - { "config", required_argument, 0, 'c' }, - { "help", no_argument, 0, 'h' }, - { "output", required_argument, 0, 'o' }, - { "stylesheet", required_argument, 0, 's' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; - -/** - * The encoding to use for the output file. - */ -static const std::string encoding = "utf-8"; - -/** - * The name of the scheduler config file to use. - */ -static Ptr::Ref configFileName; - -/** - * The output XML file name. - */ -static Ptr::Ref xmlOutFileName; - -/** - * The XSLT attached to the output file. - */ -static Ptr::Ref xsltFileName; - - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -static void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -static void -printUsage ( const char invocation[], - std::ostream & os ); - -/** - * Process command line arguments. - * - * @param argc the number of arguments. - * @param argv the arguments themselves. - * @return true of all went well, false in case the program should exit - * after this call. - */ -static bool -processArguments(int argc, char *argv[]); - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Run all tests - *----------------------------------------------------------------------------*/ -int -main( int argc, - char * argv[] ) throw () -{ - if (!processArguments(argc, argv)) { - return 0; - } - - // Configure the test methods via their shared base class - try { - LiveSupport::Scheduler::BaseTestMethod::configure(*configFileName); - } catch (std::exception &e) { - std::cerr << "configuration error: " << e.what() << std::endl; - return 1; - } - - // Create the event manager and test controller - CPPUNIT_NS::TestResult controller; - - // Add a listener that colllects test result - CPPUNIT_NS::TestResultCollector result; - controller.addListener( &result ); - - // Add a listener that print dots as test run. - CPPUNIT_NS::BriefTestProgressListener progress; - controller.addListener( &progress ); - - // Add the top suite to the test runner - CPPUNIT_NS::TestRunner runner; - runner.addTest( CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest() ); - runner.run( controller ); - - // Print test in a compiler compatible format. - CPPUNIT_NS::CompilerOutputter outputter( &result, std::cerr ); - outputter.setLocationFormat("%p:%l:"); - outputter.write(); - - // also generate an XML document as an output - std::ofstream xmlOutFile(xmlOutFileName->c_str()); - CPPUNIT_NS::XmlOutputter xmlOutputter(&result, xmlOutFile, encoding); - xmlOutputter.setStandalone(false); - if (xsltFileName) { - xmlOutputter.setStyleSheet(*xsltFileName); - } - xmlOutputter.write(); - xmlOutFile.flush(); - xmlOutFile.close(); - - return result.wasSuccessful() ? 0 : 1; -} - - -/*------------------------------------------------------------------------------ - * Process command line arguments. - *----------------------------------------------------------------------------*/ -static bool -processArguments(int argc, char *argv[]) -{ - int i; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'c': - configFileName.reset(new std::string(optarg)); - break; - - case 'h': - printUsage(argv[0], std::cout); - return false; - - case 'o': - xmlOutFileName.reset(new std::string(optarg)); - break; - - case 's': - xsltFileName.reset(new std::string(optarg)); - break; - - case 'v': - printVersion(std::cout); - return false; - - default: - printUsage(argv[0], std::cout); - return false; - } - } - - if (optind < argc) { - std::cerr << "error processing command line arguments" << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - if (!configFileName) { - std::cerr << "mandatory option configuration file name not specified" - << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - if (!xmlOutFileName) { - std::cerr << "mandatory option output file name not specified" - << std::endl; - printUsage(argv[0], std::cout); - return false; - } - - std::cerr << "using config file '" << *configFileName << '\'' << std::endl; - std::cerr << "writing output to '" << *xmlOutFileName << '\'' << std::endl; - if (xsltFileName) { - std::cerr << "using XSLT file '" << *xsltFileName << '\'' << std::endl; - } - - return true; -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -static void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -static void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << "Unit test runner" << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION]" - << std::endl - << " mandatory options:" << std::endl - << " -o, --output=file.name write test results into this XML file" - << std::endl - << " optional options:" << std::endl - << " -s, --stylesheet specify this XSLT for the output file" - << std::endl - << " this is either an absolute URI, or a" - << std::endl - << " relative path for the output document" - << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/products/scheduler/src/UploadPlaylistMethod.cxx b/src/products/scheduler/src/UploadPlaylistMethod.cxx deleted file mode 100644 index 87855dfd6..000000000 --- a/src/products/scheduler/src/UploadPlaylistMethod.cxx +++ /dev/null @@ -1,174 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#ifdef HAVE_TIME_H -#include -#else -#error need time.h -#endif - - -#include - -#include "LiveSupport/Core/XmlRpcTools.h" -#include "LiveSupport/StorageClient/StorageClientInterface.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "ScheduleInterface.h" -#include "ScheduleFactory.h" -#include "SchedulerDaemon.h" - -#include "UploadPlaylistMethod.h" - - -using namespace boost; -using namespace boost::posix_time; - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::StorageClient; - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of this XML-RPC method. - *----------------------------------------------------------------------------*/ -const std::string UploadPlaylistMethod::methodName = "uploadPlaylist"; - -/*------------------------------------------------------------------------------ - * The ID of this method for error reporting purposes. - *----------------------------------------------------------------------------*/ -const int UploadPlaylistMethod::errorId = 1400; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Construct the method and register it right away. - *----------------------------------------------------------------------------*/ -UploadPlaylistMethod :: UploadPlaylistMethod ( - Ptr::Ref xmlRpcServer) throw() - : XmlRpc::XmlRpcServerMethod(methodName, xmlRpcServer.get()) -{ -} - - -/*------------------------------------------------------------------------------ - * Execute the upload playlist method XML-RPC function call. - *----------------------------------------------------------------------------*/ -void -UploadPlaylistMethod :: execute(XmlRpc::XmlRpcValue & rootParameter, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException) -{ - if (!rootParameter.valid() || rootParameter.size() != 1 - || !rootParameter[0].valid()) { - XmlRpcTools::markError(errorId+1, "invalid argument format", - returnValue); - return; - } - XmlRpc::XmlRpcValue parameters = rootParameter[0]; - - Ptr::Ref sessionId; - try{ - sessionId = XmlRpcTools::extractSessionId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+20, - "missing session ID argument", - returnValue); - return; - } - - Ptr::Ref playlistId; - try { - playlistId = XmlRpcTools::extractPlaylistId(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+2, "missing playlist ID argument", - returnValue); - return; - } - - Ptr::Ref playschedule; - try { - playschedule = XmlRpcTools::extractPlayschedule(parameters); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+3, "missing playtime argument", - returnValue); - return; - } - - Ptr::Ref scf - = StorageClientFactory::getInstance(); - Ptr::Ref storage - = scf->getStorageClient(); - - Ptr::Ref playlist; - try { - playlist = storage->getPlaylist(sessionId, playlistId); - } catch (Core::XmlRpcException &e) { - std::string eMsg = "playlist not found:\n"; - eMsg += e.what(); - XmlRpcTools::markError(errorId+4, eMsg, returnValue); - return; - } - - Ptr::Ref until(new ptime(*playschedule - + *(playlist->getPlaylength()))); - - Ptr::Ref sf = ScheduleFactory::getInstance(); - Ptr::Ref schedule = sf->getSchedule(); - - if (!schedule->isTimeframeAvailable(playschedule, until)) { - XmlRpcTools::markError(errorId+5, "timeframe not available", - returnValue); - return; - } - - Ptr::Ref scheduleEntryId; - try { - scheduleEntryId = schedule->schedulePlaylist(playlist, playschedule); - } catch (std::invalid_argument &e) { - XmlRpcTools::markError(errorId+6, e.what(), - returnValue); - return; - } - - // tell the scheduler daemon to reload the scheduled events - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - scheduler->update(); - - XmlRpcTools::scheduleEntryIdToXmlRpcValue(scheduleEntryId, returnValue); -} diff --git a/src/products/scheduler/src/UploadPlaylistMethod.h b/src/products/scheduler/src/UploadPlaylistMethod.h deleted file mode 100644 index 05fdd5288..000000000 --- a/src/products/scheduler/src/UploadPlaylistMethod.h +++ /dev/null @@ -1,160 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef UploadPlaylistMethod_h -#define UploadPlaylistMethod_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" -#include "LiveSupport/Core/UniqueId.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * An XML-RPC method object to accept a playlist for upload, - * and schedule it in the scheduler. - * - * The name of the method when called through XML-RPC is "uploadPlaylist". - * - * The expected parameter is an XML-RPC structure, with the following - * members: - *
    - *
  • sessionId - string - the session ID obtained via the login() - * method of the authentication client
  • - *
  • playlistId - string - the id of the playlist to upload
  • - *
  • playtime - datetime - the time when the playlist should be - * scheduled, an ISO 8601 DateTime field
  • - *
- * - * The playlistId parameter is a string containing the hexadecimal value of - * the playlist ID. - * It is up to 8 characters long, representing a value between 0 and 2^31-1, - * inclusive. - * - * If the upload is successful, the method returns an XML-RPC structure with - * the following members: - *
    - *
  • scheduleEntryId - string - the id of the schedule entry created - * by the upload
  • - *
- * - * In case of an error, a standard XML-RPC fault response is generated, - * and a { faultCode, faultString } structure is returned. The - * possible errors are: - *
    - *
  • 1401 - invalid argument format
  • - *
  • 1402 - missing playlist ID argument
  • - *
  • 1403 - missing playtime argument
  • - *
  • 1404 - playlist not found
  • - *
  • 1405 - timeframe not available
  • - *
  • 1406 - could not schedule playlist
  • - *
  • 1420 - missing session ID argument
  • - *
- * - */ -class UploadPlaylistMethod : public XmlRpc::XmlRpcServerMethod -{ - private: - /** - * The name of this method, as it will be registered into the - * XML-RPC server. - */ - static const std::string methodName; - - /** - * The ID of this method for error reporting purposes. - */ - static const int errorId; - - - public: - /** - * A default constructor, for testing purposes. - */ - UploadPlaylistMethod(void) throw () - : XmlRpc::XmlRpcServerMethod(methodName) - { - } - - /** - * Constuctor that registers the method with the server right away. - * - * @param xmlRpcServer the XML-RPC server to register with. - */ - UploadPlaylistMethod( - Ptr::Ref xmlRpcServer) - throw (); - - /** - * Execute the upload playlist command on the Scheduler daemon. - * - * @param parameters XML-RPC function call parameters - * @param returnValue the return value of the call (out parameter) - */ - void - execute( XmlRpc::XmlRpcValue & parameters, - XmlRpc::XmlRpcValue & returnValue) - throw (XmlRpc::XmlRpcException); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // UploadPlaylistMethod_h - diff --git a/src/products/scheduler/src/UploadPlaylistMethodTest.cxx b/src/products/scheduler/src/UploadPlaylistMethodTest.cxx deleted file mode 100644 index 087fb0b1b..000000000 --- a/src/products/scheduler/src/UploadPlaylistMethodTest.cxx +++ /dev/null @@ -1,254 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - - -#include -#include -#include -#include - -#include "LiveSupport/Db/ConnectionManagerFactory.h" -#include "LiveSupport/StorageClient/StorageClientFactory.h" -#include "LiveSupport/Authentication/AuthenticationClientFactory.h" -#include "ScheduleFactory.h" - -#include "UploadPlaylistMethod.h" -#include "UploadPlaylistMethodTest.h" - -using namespace LiveSupport::Db; -using namespace LiveSupport::StorageClient; -using namespace LiveSupport::Scheduler; -using namespace LiveSupport::Authentication; - - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -CPPUNIT_TEST_SUITE_REGISTRATION(UploadPlaylistMethodTest); - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Set up the test environment - *----------------------------------------------------------------------------*/ -void -UploadPlaylistMethodTest :: setUp(void) throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref scheduler = SchedulerDaemon::getInstance(); - try { - Ptr::Ref storage = scheduler->getStorage(); - storage->reset(); - - schedule = scheduler->getSchedule(); - - } catch (XmlRpcException &e) { - std::cerr << "caught XmlRpcException durng setUp" << std::endl - << e.what() << std::endl; - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in configuration file" << std::endl; - } catch (xmlpp::exception &e) { - std::cerr << "error parsing configuration file" << std::endl; - } catch (std::exception &e) { - std::cerr << e.what() << std::endl; - } - - authentication = scheduler->getAuthentication(); - try { - sessionId = authentication->login("root", "q"); - } catch (XmlRpcException &e) { - std::cerr << "could not log in:" << std::endl - << e.what() << std::endl; - } -} - - -/*------------------------------------------------------------------------------ - * Clean up the test environment - *----------------------------------------------------------------------------*/ -void -UploadPlaylistMethodTest :: tearDown(void) throw (CPPUNIT_NS::Exception) -{ - authentication->logout(sessionId); - sessionId.reset(); - authentication.reset(); -} - - -/*------------------------------------------------------------------------------ - * Just a very simple smoke test - *----------------------------------------------------------------------------*/ -void -UploadPlaylistMethodTest :: firstTest(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new UploadPlaylistMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - - // set up a structure for the parameters - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 18; - time.tm_min = 31; - time.tm_sec = 1; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); -} - - -/*------------------------------------------------------------------------------ - * Try to upload overlapping playlists, and see them fail. - *----------------------------------------------------------------------------*/ -void -UploadPlaylistMethodTest :: overlappingPlaylists(void) - throw (CPPUNIT_NS::Exception) -{ - Ptr::Ref method(new UploadPlaylistMethod()); - XmlRpc::XmlRpcValue parameters; - XmlRpc::XmlRpcValue rootParameter; - rootParameter.setSize(1); - XmlRpc::XmlRpcValue result; - struct tm time; - - // load the first playlist, this will succeed - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 0; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - - // try to load the same one, but in an overlapping time region - // (we know that playlist with id 1 is 1 hour long) - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 30; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - CPPUNIT_FAIL("allowed to schedule overlapping playlist"); - } catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 1405); // timeframe not available - } - - // try to load the same one, but now in good timing - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 11; - time.tm_min = 30; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - } catch (XmlRpc::XmlRpcException &e) { - std::stringstream eMsg; - eMsg << "XML-RPC method returned error: " << e.getCode() - << " - " << e.getMessage(); - CPPUNIT_FAIL(eMsg.str()); - } - CPPUNIT_ASSERT(result.hasMember("scheduleEntryId")); - - // try to load the same one, this time overlapping both previos instances - parameters["sessionId"] = sessionId->getId(); - parameters["playlistId"] = "0000000000000001"; - time.tm_year = 2001; - time.tm_mon = 11; - time.tm_mday = 12; - time.tm_hour = 10; - time.tm_min = 45; - time.tm_sec = 0; - parameters["playtime"] = &time; - rootParameter[0] = parameters; - - result.clear(); - try { - method->execute(rootParameter, result); - CPPUNIT_FAIL("allowed to schedule doubly overlapping playlist"); - } catch (XmlRpc::XmlRpcException &e) { - CPPUNIT_ASSERT(e.getCode() == 1405); // timeframe not available - } -} diff --git a/src/products/scheduler/src/UploadPlaylistMethodTest.h b/src/products/scheduler/src/UploadPlaylistMethodTest.h deleted file mode 100644 index 1423a1b41..000000000 --- a/src/products/scheduler/src/UploadPlaylistMethodTest.h +++ /dev/null @@ -1,133 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef UploadPlaylistMethodTest_h -#define UploadPlaylistMethodTest_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include - -#include "LiveSupport/Authentication/AuthenticationClientInterface.h" -#include "LiveSupport/Core/SessionId.h" -#include "SchedulerDaemon.h" -#include "BaseTestMethod.h" - -namespace LiveSupport { -namespace Scheduler { - -using namespace LiveSupport; -using namespace LiveSupport::Core; -using namespace LiveSupport::Authentication; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Unit test for the UploadPlaylistMethod class. - * - * @see UploadPlaylistMethod - */ -class UploadPlaylistMethodTest : public CPPUNIT_NS::TestFixture -{ - CPPUNIT_TEST_SUITE(UploadPlaylistMethodTest); - CPPUNIT_TEST(firstTest); - CPPUNIT_TEST(overlappingPlaylists); - CPPUNIT_TEST_SUITE_END(); - - private: - - /** - * The schedule used during the test. - */ - Ptr::Ref schedule; - - /** - * The authentication client produced by the factory. - */ - Ptr::Ref authentication; - - /** - * A session ID from the authentication client login() method. - */ - Ptr::Ref sessionId; - - - protected: - - /** - * A simple test. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - firstTest(void) throw (CPPUNIT_NS::Exception); - - /** - * Try to upload overlapping playlists, and see them fail. - * - * @exception CPPUNIT_NS::Exception on test failures. - */ - void - overlappingPlaylists(void) throw (CPPUNIT_NS::Exception); - - public: - - /** - * Set up the environment for the test case. - */ - void - setUp(void) throw (CPPUNIT_NS::Exception); - - /** - * Clean up the environment after the test case. - */ - void - tearDown(void) throw (CPPUNIT_NS::Exception); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // UploadPlaylistMethodTest_h - diff --git a/src/products/scheduler/src/XmlRpcDaemon.cxx b/src/products/scheduler/src/XmlRpcDaemon.cxx deleted file mode 100644 index e02afccad..000000000 --- a/src/products/scheduler/src/XmlRpcDaemon.cxx +++ /dev/null @@ -1,369 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_STDIO_H -#include -#else -#error "Need stdio.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_FCNTL_H -#include -#else -#error "Need fcntl.h" -#endif - -#if HAVE_SIGNAL_H -#include -#else -#error "Need signal.h" -#endif - -#if HAVE_SYS_STAT_H -#include -#else -#error "Need sys/stat.h" -#endif - - -#include -#include -#include -#include - -#include "SignalDispatcher.h" -#include "XmlRpcDaemonShutdownSignalHandler.h" -#include "XmlRpcDaemon.h" -#include - - -using namespace LiveSupport::Scheduler; - -GMainLoop *loop; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/*------------------------------------------------------------------------------ - * The name of the config element for this class - *----------------------------------------------------------------------------*/ -const std::string XmlRpcDaemon::configElementNameStr = - "xmlRpcDaemon"; - -/** - * The name of the XML configuration attribute for the XML-RPC host name. - */ -static const std::string confXmlRpcHostAttr = "xmlRpcHost"; - -/** - * The name of the XML configuration attribute for the XML-RPC port. - */ -static const std::string confXmlRpcPortAttr = "xmlRpcPort"; - -/** - * The name of the XML configuration attribute for the process id file. - */ -static const std::string confPidFileNameAttr = "pidFileName"; - -/** - * The umask used by the daemon for file creations - */ -static const mode_t uMask = 022; - - -/* =============================================== local function prototypes */ - - -/* ============================================================= module code */ - -/*------------------------------------------------------------------------------ - * Configure the Scheder daemon according to an XML element - *----------------------------------------------------------------------------*/ -void -XmlRpcDaemon :: configureXmlRpcDaemon( - const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) -{ - if (configured) { - throw std::logic_error("already configured"); - } - - const xmlpp::Attribute * attribute = 0; - std::stringstream strStr; - - if (element.get_name() != configElementNameStr) { - std::string eMsg = "Bad configuration element "; - eMsg += element.get_name(); - throw std::invalid_argument(eMsg); - } - - if (!(attribute = element.get_attribute(confXmlRpcHostAttr))) { - std::string eMsg = "Missing attribute "; - eMsg += confXmlRpcHostAttr; - throw std::invalid_argument(eMsg); - } - xmlRpcHost = attribute->get_value(); - - if (!(attribute = element.get_attribute(confXmlRpcPortAttr))) { - std::string eMsg = "Missing attribute "; - eMsg += confXmlRpcPortAttr; - throw std::invalid_argument(eMsg); - } - strStr.str(attribute->get_value()); - strStr >> xmlRpcPort; - - if (!(attribute = element.get_attribute(confPidFileNameAttr))) { - std::string eMsg = "Missing attribute "; - eMsg += confPidFileNameAttr; - throw std::invalid_argument(eMsg); - } - pidFileName = attribute->get_value(); - - configured = true; -} - - -/*------------------------------------------------------------------------------ - * Do all the necessary work of becoming a daemon. - * See http://www.enderunix.org/docs/eng/daemon.php and - * http://www.linuxprofilm.com/articles/linux-daemon-howto.html - * for hints. - *----------------------------------------------------------------------------*/ -bool -XmlRpcDaemon :: daemonize(void) throw (std::runtime_error) -{ - int i; - - if (getppid() == 1) { - // we're already a daemon - return true; - } - - i = fork(); - if (i < 0) { - throw std::runtime_error("fork error"); - } else if (i > 0) { - // this is the parent, simply return - return false; - } - // for twice, so that we're totally detached from our ancestor - i = fork(); - if (i < 0) { - throw std::runtime_error("fork error"); - } else if (i > 0) { - // this is the parent, simply return - return false; - } - - // now we're in the child process - - // obtain a new process group - setsid(); - - // change the umask - umask(uMask); - - /* TODO: wait with this until we have logging - // close standard file descriptors - for (i=getdtablesize();i>=0;--i) close(i); // - - // set all std in/out to /dev/null - i=open("/dev/null",O_RDWR); // open stdin - dup(i); // stdout - dup(i); // stderr - */ - - // save the process id - savePid(); - - // ignore some signals - signal(SIGCHLD,SIG_IGN); - signal(SIGTSTP,SIG_IGN); - signal(SIGTTOU,SIG_IGN); - signal(SIGTTIN,SIG_IGN); - - // register our signal hanlder - SignalDispatcher * signalDispatcher = SignalDispatcher::getInstance(); - XmlRpcDaemonShutdownSignalHandler * handler = - new XmlRpcDaemonShutdownSignalHandler(this); - signalDispatcher->registerHandler(SIGHUP, handler); - signalDispatcher->registerHandler(SIGTERM, handler); - // FIXME: this signal handler will not be deleted by anyone, - // possible memory leak - - return true; -} - - -/*------------------------------------------------------------------------------ - * Save the current process id. - *----------------------------------------------------------------------------*/ -void -XmlRpcDaemon :: savePid(void) throw () -{ - std::ofstream pidFile(pidFileName.c_str()); - pidFile << getpid(); - pidFile.flush(); - pidFile.close(); -} - - -/*------------------------------------------------------------------------------ - * Return the saved process id. - *----------------------------------------------------------------------------*/ -pid_t -XmlRpcDaemon :: loadPid(void) throw () -{ - pid_t pid; - - std::ifstream pidFile(pidFileName.c_str()); - if (pidFile.fail()) { - //std::cout << "XmlRpcDaemon::loadPid - Failed to open file " << pidFileName.c_str() << "\n"; - return 0; - } - - pidFile >> pid; - pidFile.close(); - - return pid; -} - - -/*------------------------------------------------------------------------------ - * Start the daemon. - *----------------------------------------------------------------------------*/ -void -XmlRpcDaemon :: start (void) throw (std::logic_error) -{ - checkForConfiguration(); - - if (isRunning()) { - std::cout << "Campcaster Scheduler is already running.\n"; - return; - } - - if (background) { - if (!daemonize()) { - // return if we're the parent process that should not continue - return; - } - } - - startup(); -} - - -/*------------------------------------------------------------------------------ - * Execute any daemon startup calls. - *----------------------------------------------------------------------------*/ -void -XmlRpcDaemon :: startup (void) throw (std::logic_error) -{ - // and now our own XML-RPC methods - registerXmlRpcFunctions(xmlRpcServer); - - // bind & run - xmlRpcServer->enableIntrospection(true); - xmlRpcServer->bindAndListen(xmlRpcPort); - active = true; - loop = g_main_loop_new (NULL, FALSE); - GMainContext* maincontext = g_main_context_default(); - while(active) - { - while (active && g_main_context_pending (maincontext)) { - g_main_context_iteration(maincontext, FALSE); - } - xmlRpcServer->work(0.); - g_usleep(G_USEC_PER_SEC/20); - } - -// xmlRpcServer->work(-1.0); -} - - -/*------------------------------------------------------------------------------ - * Tell if the daemon is running. - *----------------------------------------------------------------------------*/ -bool -XmlRpcDaemon :: isRunning (void) throw (std::logic_error) -{ - checkForConfiguration(); - - pid_t pid = loadPid(); - // check if there is a stale pid stored - if (pid && kill(pid, 0)) { - if (errno == ESRCH) { - // the pid does not exist, remove the stale pid file - remove(pidFileName.c_str()); - pid = 0; - } - } - //std::cout << "XmlRpcDaemon::isRunning - pid is " << pid << "\n"; - return pid; -} - - -/*------------------------------------------------------------------------------ - * Stop the daemon. - *----------------------------------------------------------------------------*/ -void -XmlRpcDaemon :: stop (void) throw (std::logic_error) -{ - checkForConfiguration(); - - pid_t pid = loadPid(); - if (pid) { - kill(pid, SIGTERM); - } -} - - -/*------------------------------------------------------------------------------ - * Shut down the daemon. - *----------------------------------------------------------------------------*/ -void -XmlRpcDaemon :: shutdown (void) throw (std::logic_error) -{ - active = false; - checkForConfiguration(); - - xmlRpcServer->shutdown(); - remove(pidFileName.c_str()); -} - - diff --git a/src/products/scheduler/src/XmlRpcDaemon.h b/src/products/scheduler/src/XmlRpcDaemon.h deleted file mode 100644 index caff2ca71..000000000 --- a/src/products/scheduler/src/XmlRpcDaemon.h +++ /dev/null @@ -1,434 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef XmlRpcDaemon_h -#define XmlRpcDaemon_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_SYS_TYPES_H -#include -#else -#error "Need sys/types.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#include -#include -#include -#include - -#include "LiveSupport/Core/Ptr.h" - - -namespace LiveSupport { -namespace Scheduler { - -using namespace XmlRpc; -using namespace LiveSupport::Core; - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * A generic XML-RPC daemon, that has to be sublclassed to provide - * real functionality. - * - * To use this class, subclass it, and override the configure() and - * registerXmlRpcFunctions() functions. - * - * The typical usage of the XmlRpcDaemon is as follows. To start the - * daemon: - *
    - *
  1. create an instance of a subclass of XmlRpcDaemon
  2. - *
  3. call the configure() method with a proper XML element
  4. - *
  5. optionally call setBackground()
  6. - *
  7. call start() to start the daemon
  8. - *
- * Stopping the daemon is similar: - *
    - *
  1. create an instance of a subclass of XmlRpcDaemon
  2. - *
  3. call the configure() method with a proper XML element - * if it has not yet been configured
  4. - *
  5. call stop() to stop the daemon
  6. - *
- * - * The structure of the XML configuration element used to configure the - * XML-RPC daemon is as follows: - * - *

- *  
- *  
- * - * The DTD for the above is: - *

- *  
- *  
- *  
- *  
- *  
- *  
- * - * - */ -class XmlRpcDaemon -{ - private: - /** - * The name of the configuration XML elmenent used by this object. - */ - static const std::string configElementNameStr; - - /** - * The host the XML-RPC server the daemon is - * listening on. - */ - std::string xmlRpcHost; - - /** - * The port the XML-RPC server the daemon is - * listening on. - */ - unsigned int xmlRpcPort; - - /** - * The name of the file where the daemon saves it's process id when - * running. - */ - std::string pidFileName; - - /** - * Flag indicating if the singleton instnace has been - * configured already. - */ - bool configured; - - /** - * Flag indicating wether to fork into background as a daemon - * or don't (good for debugging, for example). - * Defaults to true. - */ - bool background; - - /** - * The XML-RPC server running within the Scheduler Daemon. - */ - Ptr::Ref xmlRpcServer; - - /** - * Do all the necessary tasks of becoming a daemon. - * - * @return true if we're in the daemon process, false - * if we're in the parent process that should not continue - * @exception std::runtime_error on forking errors - */ - bool - daemonize(void) throw (std::runtime_error); - - /** - * Save the current process id to the process id file - */ - void - savePid(void) throw(); - - /** - * Return the saved process id. - * - * @return the saved process id of the daemon, or 0 if none saved. - */ - pid_t - loadPid(void) throw(); - - bool active; - - protected: - /** - * Default constructor. - */ - XmlRpcDaemon (void) throw () - { - background = true; - configured = false; - active = false; - xmlRpcServer.reset(new XmlRpcServer()); - } - - /** - * Virtual destructor. - */ - virtual - ~XmlRpcDaemon(void) throw () - { - } - - /** - * Check if the daemon has already been configured, - * and raise an exception if not so. - * - * @exception std::logic_error if the daemon has not yet been - * configured. - */ - void - checkForConfiguration(void) const throw (std::logic_error) - { - if (!configured) { - throw std::logic_error("not yet configured"); - } - } - - /** - * Configure the XML-RPC daemon itself. Pass an <xmlRpcDaemon> - * element to this function. - * - * @param element the XML element to configure the XML-RPC - * daemon from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the daemon has already - * been configured. - */ - void - configureXmlRpcDaemon(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error); - - - /** - * Register your XML-RPC functions by implementing this function. - */ - virtual void - registerXmlRpcFunctions(Ptr::Ref xmlRpcServer) - throw (std::logic_error) - = 0; - - /** - * Execute any calls when the daemon is starting up. - * All resources allocated here should be freed up in shutdown(). - * This function will only return when the daemon ha stopped - * running. - * - * @exception std::logic_error if startup could not succeed. - * @see #shutdown - */ - virtual void - startup (void) throw (std::logic_error); - - - public: - /** - * Return the name of the XML element this object expects - * to be sent to a call to configure(). - * - * @return the name of the expected XML configuration element. - */ - static const std::string - getConfigElementName(void) throw () - { - return configElementNameStr; - } - - /** - * Tell if the daemon has already been configured. - * If so, an attempt to configure it again will result in an - * exception. - * - * @return true if the daemon has already been - * configured, false otherwise. - */ - const bool - isConfigured(void) const throw () - { - return configured; - } - - /** - * Set if the XML-RPC server should fork into background. - * - * @param background if true, the XML-RPC server will fork into - * background, otherwise not (good for debugging). - */ - void - setBackground(const bool background) throw () - { - this->background = background; - } - - /** - * Tell if the XML-RPC server will fork into background. - * - * @return if true, the XML-RPC server will fork into - * background, otherwise not (good for debugging). - */ - const bool - getBackground(void) const throw () - { - return background; - } - - /** - * Configure the daemon based on the XML element - * supplied. - * Implemtors should call the funtion configureXmlRpcDaemon - * from here with a proper <xmlRpcDaemon> element. - * - * @param element the XML element to configure the - * daemon from. - * @exception std::invalid_argument if the supplied XML element - * contains bad configuraiton information - * @exception std::logic_error if the daemon has already - * been configured. - * @see #configureXmlRpcDaemon - */ - virtual void - configure(const xmlpp::Element & element) - throw (std::invalid_argument, - std::logic_error) - = 0; - - /** - * Tell the host name of the XML-RPC server the - * daemon is listening on. - * - * @return the host name of the XML-RPC server the - * daemon is listening on. - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - const std::string - getXmlRpcHost(void) const throw (std::logic_error) - { - checkForConfiguration(); - return xmlRpcHost; - } - - /** - * Tell the port of the XML-RPC server the - * daemon is listening on. - * - * @return the port of the XML-RPC server the - * daemon is listening on. - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - const unsigned int - getXmlRpcPort(void) const throw (std::logic_error) - { - checkForConfiguration(); - return xmlRpcPort; - } - - /** - * Tell the file name where the daemon stores its process id. - * - * @return the name of the file where the process id is stored. - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - const std::string - getPidFileName(void) const throw (std::logic_error) - { - checkForConfiguration(); - return pidFileName; - } - - /** - * Start the daemon. - * - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - void - start (void) throw (std::logic_error); - - /** - * Tell if the daemon is running. - * If there is a stale pid file stored for the daemon, it is - * removed during checking (and correctly false is returned). - * - * @return true of the daemon is running, false otherwise. - * @exception std::logic_error if the daemon has not - * yet been configured. - */ - bool - isRunning (void) throw (std::logic_error); - - /** - * Stop the daemon. - * This function just sends a signal, which will result in - * shutdown() to get called eventually. - * - * @exception std::logic_error if the daemon has not - * yet been configured. - * @see #shutdown - */ - void - stop (void) throw (std::logic_error); - - /** - * Shut down the daemon. - * This function is public only because the signal handler - * needs visibility to this function, which will call it. - * A call to stop() will trigger a signal that will call shutdown(). - * - * @exception std::logic_error if the daemon has not - * yet been configured. - * @see #stop - */ - virtual void - shutdown (void) throw (std::logic_error); -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // XmlRpcDaemon_h - diff --git a/src/products/scheduler/src/XmlRpcDaemonShutdownSignalHandler.h b/src/products/scheduler/src/XmlRpcDaemonShutdownSignalHandler.h deleted file mode 100644 index 61f8f26ad..000000000 --- a/src/products/scheduler/src/XmlRpcDaemonShutdownSignalHandler.h +++ /dev/null @@ -1,111 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ -#ifndef XmlRpcDaemonShutdownSignalHandler_h -#define XmlRpcDaemonShutdownSignalHandler_h - -#ifndef __cplusplus -#error This is a C++ include file -#endif - - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#include "SignalHandler.h" -#include "XmlRpcDaemon.h" - - -namespace LiveSupport { -namespace Scheduler { - -/* ================================================================ constants */ - - -/* =================================================================== macros */ - - -/* =============================================================== data types */ - -/** - * Signal handler to shut down an XmlRpcDaemon. - * - * @see XmlRpcDaemon - */ -class XmlRpcDaemonShutdownSignalHandler : public SignalHandler -{ - private: - /** - * The XmlRpcDaemon to shut down. - */ - XmlRpcDaemon * xmlRpcDaemon; - - public: - /** - * Constructor. - * - * @param xmlRpcDaemon the XmlRpcDaemon to shut down when the - * handler is invoked. - */ - XmlRpcDaemonShutdownSignalHandler( - XmlRpcDaemon * xmlRpcDaemon) - throw () - { - this->xmlRpcDaemon = xmlRpcDaemon; - } - - /** - * Handle the signal. Shuts down the XmlRpcDaemon used to - * construct this handler. - * - * @param signal the actual signal received. - */ - virtual void - handleSignal(int signal) throw () - { - xmlRpcDaemon->shutdown(); - } - - /** - * A virtual destructor, as this class has virtual functions. - */ - virtual - ~XmlRpcDaemonShutdownSignalHandler(void) throw () - { - } -}; - - -/* ================================================= external data structures */ - - -/* ====================================================== function prototypes */ - - -} // namespace Scheduler -} // namespace LiveSupport - -#endif // XmlRpcDaemonShutdownSignalHandler_h - diff --git a/src/products/scheduler/src/main.cxx b/src/products/scheduler/src/main.cxx deleted file mode 100644 index c4c00f2c6..000000000 --- a/src/products/scheduler/src/main.cxx +++ /dev/null @@ -1,244 +0,0 @@ -/*------------------------------------------------------------------------------ - - Copyright (c) 2010 Sourcefabric O.P.S. - - This file is part of the Campcaster project. - http://campcaster.sourcefabric.org/ - - Campcaster is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - Campcaster is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with Campcaster; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -------------------------------------------------------------------------------*/ - -/** @file - * This file contains the main entry point to the Scheduler daemon. - */ - -/* ============================================================ include files */ - -#ifdef HAVE_CONFIG_H -#include "configure.h" -#endif - -#if HAVE_UNISTD_H -#include -#else -#error "Need unistd.h" -#endif - -#if HAVE_GETOPT_H -#include -#else -#error "Need getopt.h" -#endif - -#include -#include -#include -#include - -#include "SchedulerDaemon.h" - - -using namespace LiveSupport::Scheduler; - -/* =================================================== local data structures */ - - -/* ================================================ local constants & macros */ - -/** - * Our copyright notice, should be at most 80 columns - */ -static const char copyrightNotice[] = - "Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL"; - -/** - * String describing the short options. - */ -static const char options[] = "c:dhv"; - -/** - * Structure describing the long options - */ -static const struct option longOptions[] = { - { "config", required_argument, 0, 'c' }, - { "debug", no_argument, 0, 'd' }, - { "help", no_argument, 0, 'h' }, - { "version", no_argument, 0, 'v' }, - { 0, 0, 0, 0 } -}; - -/** - * The start command: "start" - */ -static const std::string startCommand = "start"; - -/** - * The status command: "status" - */ -static const std::string statusCommand = "status"; - -/** - * The stop command: "stop" - */ -static const std::string stopCommand = "stop"; - - -/* =============================================== local function prototypes */ - -/** - * Print program version. - * - * @param os the std::ostream to print to. - */ -static void -printVersion ( std::ostream & os ); - -/** - * Print program usage information. - * - * @param invocation the command line command used to invoke this program. - * @param os the std::ostream to print to. - */ -static void -printUsage ( const char invocation[], - std::ostream & os ); - - -/* ============================================================= module code */ - -/** - * Program entry point. - * - * @param argc the number of command line arguments passed by the user. - * @param argv the command line arguments passed by the user. - * @return 0 on success, non-0 on failure. - */ -int main ( int argc, - char * argv[] ) -{ - int i; - std::string configFileName; - bool debugMode = false; - - while ((i = getopt_long(argc, argv, options, longOptions, 0)) != -1) { - switch (i) { - case 'c': - configFileName = optarg; - break; - - case 'd': - debugMode = true; - break; - - case 'h': - printUsage(argv[0], std::cout); - exit(EXIT_SUCCESS); - - case 'v': - printVersion(std::cout); - exit(EXIT_SUCCESS); - - default: - printUsage(argv[0], std::cout); - exit(EXIT_FAILURE); - } - } - - if (optind != argc - 1) { - printUsage(argv[0], std::cout); - exit(EXIT_FAILURE); - } - - std::cerr << "using config file '" << configFileName << '\'' << std::endl; - - Ptr::Ref daemon = SchedulerDaemon::getInstance(); - - try { - std::auto_ptr - parser(new xmlpp::DomParser(configFileName, true)); - const xmlpp::Document * document = parser->get_document(); - daemon->configure(*(document->get_root_node())); - } catch (std::invalid_argument &e) { - std::cerr << "semantic error in configuration file" << std::endl - << e.what() << std::endl; - exit(EXIT_FAILURE); - } catch (xmlpp::exception &e) { - std::cerr << "error parsing configuration file" << std::endl - << e.what() << std::endl; - exit(EXIT_FAILURE); - } - - daemon->setBackground(!debugMode); - - try { - if (startCommand == argv[optind]) { - daemon->start(); - } else if (statusCommand == argv[optind]) { - std::cout << "The Scheduler Daemon is " - << (daemon->isRunning() ? "" : "not ") - << "running" << std::endl; - } else if (stopCommand == argv[optind]) { - daemon->stop(); - } else { - printUsage(argv[0], std::cout); - exit(EXIT_FAILURE); - } - } catch (std::exception &e) { - std::cerr << "error executing command " << argv[optind] << std::endl; - std::cerr << e.what() << std::endl; - exit(EXIT_FAILURE); - } - - exit(EXIT_SUCCESS); -} - - -/*------------------------------------------------------------------------------ - * Print program version. - *----------------------------------------------------------------------------*/ -static void -printVersion ( std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << copyrightNotice << std::endl; -} - - -/*------------------------------------------------------------------------------ - * Print program usage. - *----------------------------------------------------------------------------*/ -static void -printUsage ( const char invocation[], - std::ostream & os ) -{ - os << PACKAGE_NAME << ' ' << PACKAGE_VERSION << std::endl - << std::endl - << "Usage: " << invocation << " [OPTION] COMMAND" - << std::endl - << " COMMAND is one of: start, stop, or status" - << std::endl - << std::endl - << " mandatory options:" << std::endl - << " -c, --config=file.name scheduler configuration file" << std::endl - << " optional options:" << std::endl - << " -d, --debug don't fork into background" << std::endl - << " -h, --help display this help and exit" << std::endl - << " -v, --version display version information and exit" - << std::endl - << std::endl - << "Report bugs to " << PACKAGE_BUGREPORT << std::endl; -} - diff --git a/src/products/scheduler/tmp/.keepme b/src/products/scheduler/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/products/scheduler/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/products/scheduler/var/test1.mp3 b/src/products/scheduler/var/test1.mp3 deleted file mode 100644 index f774c2164..000000000 Binary files a/src/products/scheduler/var/test1.mp3 and /dev/null differ diff --git a/src/products/scheduler/var/test2.mp3 b/src/products/scheduler/var/test2.mp3 deleted file mode 100644 index f774c2164..000000000 Binary files a/src/products/scheduler/var/test2.mp3 and /dev/null differ diff --git a/src/tools/libodbc++/libodbc++-0.2.5/bin/autogen.sh b/src/tools/libodbc++/libodbc++-0.2.5/bin/autogen.sh deleted file mode 100755 index 73f29224c..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/bin/autogen.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author: fgerlits $ -# Version : $Revision: 2674 $ -# Location : $URL: svn://source.campware.org/campcaster/trunk/campcaster/src/tools/libodbc++/libodbc++-0.2.4pre4/bin/autogen.sh $ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="libodbc++" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -#ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -#echo " aclocal $ACLOCAL_FLAGS" -#cp -f ${configure_ac} ${tmpdir} -#cp -f ${etcdir}/acinclude.m4 ${tmpdir} -#aclocal $ACLOCAL_FLAGS - -#echo " autoheader ${configure_ac}" -#autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/tools/libodbc++/libodbc++-0.2.5/bin/prepare.sh b/src/tools/libodbc++/libodbc++-0.2.5/bin/prepare.sh deleted file mode 100755 index 6a59ea758..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/bin/prepare.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author: fgerlits $ -# Version : $Revision: 3360 $ -# Location : $URL: svn://source.campware.org/campcaster/trunk/campcaster/src/tools/libodbc++/libodbc++-0.2.4pre4/bin/prepare.sh $ -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# Run this script to prepare libodbc++ 2.3 to be configured and compiled. -# To read more about libodbc++, see http://libodbcxx.sourceforge.net/ -#------------------------------------------------------------------------------- -product=libodbc++-0.2.5 - -reldir=`dirname $0`/.. -basedir=`cd ${reldir}; pwd;` -bindir=${basedir}/bin -etcdir=${basedir}/etc -tmpdir=${basedir}/tmp - -tar=$basedir/src/$product.tar.bz2 - -mkdir -p ${tmpdir} - -cd ${tmpdir} -if [ ! -d $product ]; then - tar xfj ${tar} - cd $product - - # patch accepted, will be in the next release - # http://libodbcxx.svn.sourceforge.net/viewvc/libodbcxx?view=rev&revision=154 - patch -p1 < $etcdir/libodbc++-add-cstdio-include.patch -fi - diff --git a/src/tools/libodbc++/libodbc++-0.2.5/configure b/src/tools/libodbc++/libodbc++-0.2.5/configure deleted file mode 100755 index 99d468d94..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/configure +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen $*) -fi - -(cd $tmpdir && $configure $*) - diff --git a/src/tools/libodbc++/libodbc++-0.2.5/etc/Makefile.in b/src/tools/libodbc++/libodbc++-0.2.5/etc/Makefile.in deleted file mode 100644 index d7b9e86e3..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/etc/Makefile.in +++ /dev/null @@ -1,78 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author: fgerlits $ -# Version : $Revision: 3356 $ -# Location : $URL: svn://source.campware.org/campcaster/trunk/campcaster/src/tools/libodbc++/libodbc++-0.2.4pre4/etc/Makefile.in $ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -DOXYTAG = doxytag -XSLTPROC = xsltproc -ECHO = @echo -FLAWFINDER = flawfinder - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -BASE_DIR = . -BIN_DIR = ${BASE_DIR}/bin -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -ETC_DIR = ${BASE_DIR}/etc -TMP_DIR = ${BASE_DIR}/tmp - -LIBODBCXX_VERSION = libodbc++-0.2.5 -LIBODBCXX_DIR = ${TMP_DIR}/${LIBODBCXX_VERSION} - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -all: ${TMP_DIR}/all.stamp -${TMP_DIR}/all.stamp: - ${MAKE} -C ${LIBODBCXX_DIR} - touch ${TMP_DIR}/all.stamp - -install: all ${TMP_DIR}/install.stamp -${TMP_DIR}/install.stamp: - ${MAKE} -C ${LIBODBCXX_DIR} install - touch ${TMP_DIR}/install.stamp - -clean: - ${MAKE} -C ${LIBODBCXX_DIR} clean - ${RM} ${TMP_DIR}/*.stamp - -distclean: - ${RM} ${TMP_DIR}/*.stamp - ${RMDIR} ${LIBODBCXX_DIR} - ${RMDIR} ${TMP_DIR}/auto* ${TMP_DIR}/config* ${TMP_DIR}/install-sh - - diff --git a/src/tools/libodbc++/libodbc++-0.2.5/etc/configure.ac b/src/tools/libodbc++/libodbc++-0.2.5/etc/configure.ac deleted file mode 100644 index 4a5ea959b..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/etc/configure.ac +++ /dev/null @@ -1,54 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl To report bugs, send an e-mail to bugs@campware.org -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl -dnl Author : $Author: fgerlits $ -dnl Version : $Revision: 3356 $ -dnl Location : $URL: svn://source.campware.org/campcaster/trunk/campcaster/src/tools/libodbc++/libodbc++-0.2.4pre4/etc/configure.ac $ -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(libodbc++, 0.2.5, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision: 3356 $) - -AC_CONFIG_SRCDIR(../src/libodbc++-0.2.5.tar.bz2) - - -dnl untar the sources before anything happens -../bin/prepare.sh - -cd ../tmp/libodbc++-0.2.5 -./configure --enable-threads --prefix=$prefix -cd - - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() - diff --git a/src/tools/libodbc++/libodbc++-0.2.5/etc/libodbc++-add-cstdio-include.patch b/src/tools/libodbc++/libodbc++-0.2.5/etc/libodbc++-add-cstdio-include.patch deleted file mode 100644 index 67916cb0d..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/etc/libodbc++-add-cstdio-include.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur libodbc++-0.2.5/include/odbc++/types.h libodbc++-0.2.5-cstdio/include/odbc++/types.h ---- libodbc++-0.2.5/include/odbc++/types.h 2009-03-05 14:23:21.000000000 +0100 -+++ libodbc++-0.2.5-cstdio/include/odbc++/types.h 2010-01-02 19:22:54.650900117 +0100 -@@ -25,6 +25,7 @@ - #include - - #include -+#include - #include - #include - diff --git a/src/tools/libodbc++/libodbc++-0.2.5/src/libodbc++-0.2.5.tar.bz2 b/src/tools/libodbc++/libodbc++-0.2.5/src/libodbc++-0.2.5.tar.bz2 deleted file mode 100644 index 4448b0f58..000000000 Binary files a/src/tools/libodbc++/libodbc++-0.2.5/src/libodbc++-0.2.5.tar.bz2 and /dev/null differ diff --git a/src/tools/libodbc++/libodbc++-0.2.5/tmp/.keepme b/src/tools/libodbc++/libodbc++-0.2.5/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/tools/libodbc++/libodbc++-0.2.5/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/tools/taglib/taglib-1.5/bin/autogen.sh b/src/tools/taglib/taglib-1.5/bin/autogen.sh deleted file mode 100755 index ef986713e..000000000 --- a/src/tools/taglib/taglib-1.5/bin/autogen.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="taglib" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -#ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -#echo " aclocal $ACLOCAL_FLAGS" -#cp -f ${configure_ac} ${tmpdir} -#cp -f ${etcdir}/acinclude.m4 ${tmpdir} -#aclocal $ACLOCAL_FLAGS - -#echo " autoheader ${configure_ac}" -#autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/tools/taglib/taglib-1.5/bin/prepare.sh b/src/tools/taglib/taglib-1.5/bin/prepare.sh deleted file mode 100755 index c2b4f458e..000000000 --- a/src/tools/taglib/taglib-1.5/bin/prepare.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# Run this script to prepare taglib 1.3.1 to be configured and compiled. -# For more information on taglib, -# see http://freshmeat.net/redir/taglib/47265/url_homepage/taglib -#------------------------------------------------------------------------------- -product=taglib-1.5 - -reldir=`dirname $0`/.. -basedir=`cd ${reldir}; pwd;` -bindir=${basedir}/bin -etcdir=${basedir}/etc -tmpdir=${basedir}/tmp - -tar=$basedir/src/$product.tar.gz - -mkdir -p ${tmpdir} - -cd ${tmpdir} -if [ ! -d $product ]; then - tar xfz ${tar} - cd $product - # see https://bugs.kde.org/show_bug.cgi?id=112728 - # and http://mail.kde.org/pipermail/taglib-devel/2005-June/000149.html - patch -p1 < $etcdir/taglib-1.5-length-in-microseconds.patch -fi - diff --git a/src/tools/taglib/taglib-1.5/configure b/src/tools/taglib/taglib-1.5/configure deleted file mode 100755 index 26ccda218..000000000 --- a/src/tools/taglib/taglib-1.5/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen $*) -fi - -(cd $tmpdir && $configure $*) - diff --git a/src/tools/taglib/taglib-1.5/etc/Makefile.in b/src/tools/taglib/taglib-1.5/etc/Makefile.in deleted file mode 100644 index b2a13c092..000000000 --- a/src/tools/taglib/taglib-1.5/etc/Makefile.in +++ /dev/null @@ -1,90 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -DOXYTAG = doxytag -XSLTPROC = xsltproc -ECHO = @echo -FLAWFINDER = flawfinder - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -BASE_DIR = . -BIN_DIR = ${BASE_DIR}/bin -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -ETC_DIR = ${BASE_DIR}/etc -TMP_DIR = ${BASE_DIR}/tmp - -TAGLIB_VERSION = taglib-1.5 -TAGLIB_DIR = ${TMP_DIR}/${TAGLIB_VERSION} - -prefix = @prefix@ -# datadir will be defiend as ${prefix}/share, so we need to define ${prefix} -# above -docdir = @datadir@/doc/${TAGLIB_VERSION} - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -all: ${TMP_DIR}/all.stamp -${TMP_DIR}/all.stamp: - ${MAKE} -C ${TAGLIB_DIR} - # make the reference documentation and install that as well, as the - # autoconf thing doesn't :( - cd ${TAGLIB_DIR}/doc && ${DOXYGEN} taglib.doxygen - touch ${TMP_DIR}/all.stamp - -install: all ${TMP_DIR}/install.stamp -${TMP_DIR}/install.stamp: - ${MAKE} -C ${TAGLIB_DIR} install - # make the reference documentation and install that as well, as the - # autoconf thing doesn't :( - ${MKDIR} ${docdir} - cp -pPR ${TAGLIB_DIR}/doc/* ${docdir} - touch ${TMP_DIR}/install.stamp - -clean: - ${MAKE} -C ${TAGLIB_DIR} clean - ${RM} ${TMP_DIR}/*.stamp - -distclean: - ${RM} ${TMP_DIR}/*.stamp - ${RMDIR} ${TAGLIB_DIR} - ${RMDIR} ${TMP_DIR}/auto* ${TMP_DIR}/config* ${TMP_DIR}/install-sh - - diff --git a/src/tools/taglib/taglib-1.5/etc/configure.ac b/src/tools/taglib/taglib-1.5/etc/configure.ac deleted file mode 100644 index 3f02b5fdc..000000000 --- a/src/tools/taglib/taglib-1.5/etc/configure.ac +++ /dev/null @@ -1,54 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl To report bugs, send an e-mail to bugs@campware.org -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl -dnl Author : $Author$ -dnl Version : $Revision$ -dnl Location : $URL$ -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(taglib, 1.5, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../src/taglib-1.5.tar.gz) - - -dnl untar the sources before anything happens -../bin/prepare.sh - -cd ../tmp/taglib-1.5 -./configure --prefix=$prefix -cd - - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() - diff --git a/src/tools/taglib/taglib-1.5/etc/taglib-1.5-length-in-microseconds.patch b/src/tools/taglib/taglib-1.5/etc/taglib-1.5-length-in-microseconds.patch deleted file mode 100644 index 44c49cd15..000000000 --- a/src/tools/taglib/taglib-1.5/etc/taglib-1.5-length-in-microseconds.patch +++ /dev/null @@ -1,127 +0,0 @@ -diff -ur taglib-1.5/taglib/audioproperties.h taglib-1.5-microseconds/taglib/audioproperties.h ---- taglib-1.5/taglib/audioproperties.h 2008-02-04 16:14:46.000000000 +0100 -+++ taglib-1.5-microseconds/taglib/audioproperties.h 2009-05-01 21:19:11.000000000 +0200 -@@ -65,10 +65,15 @@ - virtual ~AudioProperties(); - - /*! -- * Returns the length of the file in seconds. -+ * Returns the length of the file in seconds (rounded down). - */ - virtual int length() const = 0; - -+ /*! -+ * Returns the fractional part of the length of the file, in microseconds. -+ */ -+ virtual int length_microseconds() const { return 0; } -+ - /*! - * Returns the most appropriate bit rate for the file in kb/s. For constant - * bitrate formats this is simply the bitrate of the file. For variable -diff -ur taglib-1.5/taglib/mpeg/mpegproperties.cpp taglib-1.5-microseconds/taglib/mpeg/mpegproperties.cpp ---- taglib-1.5/taglib/mpeg/mpegproperties.cpp 2008-02-04 16:14:46.000000000 +0100 -+++ taglib-1.5-microseconds/taglib/mpeg/mpegproperties.cpp 2009-05-01 21:22:36.000000000 +0200 -@@ -58,7 +58,7 @@ - File *file; - XingHeader *xingHeader; - ReadStyle style; -- int length; -+ long long length; - int bitrate; - int sampleRate; - int channels; -@@ -89,7 +89,12 @@ - - int MPEG::Properties::length() const - { -- return d->length; -+ return int(d->length / 1000000); -+} -+ -+int MPEG::Properties::length_microseconds() const -+{ -+ return int(d->length % 1000000); - } - - int MPEG::Properties::bitrate() const -@@ -218,8 +223,9 @@ - double timePerFrame = - double(firstHeader.samplesPerFrame()) / firstHeader.sampleRate(); - -- d->length = int(timePerFrame * d->xingHeader->totalFrames()); -- d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8 / d->length / 1000 : 0; -+ d->length = (long long)( -+ timePerFrame * d->xingHeader->totalFrames() * 1000000 + 0.5); -+ d->bitrate = d->length > 0 ? d->xingHeader->totalSize() * 8000 / d->length : 0; - } - else { - // Since there was no valid Xing header found, we hope that we're in a constant -@@ -234,8 +240,9 @@ - if(firstHeader.frameLength() > 0 && firstHeader.bitrate() > 0) { - int frames = (last - first) / firstHeader.frameLength() + 1; - -- d->length = int(float(firstHeader.frameLength() * frames) / -- float(firstHeader.bitrate() * 125) + 0.5); -+ d->length = (long long)( -+ (double(firstHeader.frameLength()) * frames * 1000000) / -+ (double(firstHeader.bitrate()) * 125) + 0.5); - d->bitrate = firstHeader.bitrate(); - } - } -diff -ur taglib-1.5/taglib/mpeg/mpegproperties.h taglib-1.5-microseconds/taglib/mpeg/mpegproperties.h ---- taglib-1.5/taglib/mpeg/mpegproperties.h 2008-02-04 16:14:46.000000000 +0100 -+++ taglib-1.5-microseconds/taglib/mpeg/mpegproperties.h 2009-05-01 18:52:04.000000000 +0200 -@@ -62,6 +62,7 @@ - // Reimplementations. - - virtual int length() const; -+ virtual int length_microseconds() const; - virtual int bitrate() const; - virtual int sampleRate() const; - virtual int channels() const; -diff -ur taglib-1.5/taglib/ogg/vorbis/vorbisproperties.cpp taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.cpp ---- taglib-1.5/taglib/ogg/vorbis/vorbisproperties.cpp 2008-02-04 16:14:46.000000000 +0100 -+++ taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.cpp 2009-05-01 19:01:15.000000000 +0200 -@@ -50,7 +50,7 @@ - - File *file; - ReadStyle style; -- int length; -+ long long length; - int bitrate; - int sampleRate; - int channels; -@@ -85,7 +85,12 @@ - - int Vorbis::Properties::length() const - { -- return d->length; -+ return int(d->length / 1000000); -+} -+ -+int Vorbis::Properties::length_microseconds() const -+{ -+ return int(d->length % 1000000); - } - - int Vorbis::Properties::bitrate() const -@@ -173,7 +178,7 @@ - long long end = last->absoluteGranularPosition(); - - if(start >= 0 && end >= 0 && d->sampleRate > 0) -- d->length = (end - start) / (long long) d->sampleRate; -+ d->length = ((end - start) * 1000000) / (long long) d->sampleRate; - else - debug("Vorbis::Properties::read() -- Either the PCM values for the start or " - "end of this file was incorrect or the sample rate is zero."); -diff -ur taglib-1.5/taglib/ogg/vorbis/vorbisproperties.h taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.h ---- taglib-1.5/taglib/ogg/vorbis/vorbisproperties.h 2008-02-04 16:14:46.000000000 +0100 -+++ taglib-1.5-microseconds/taglib/ogg/vorbis/vorbisproperties.h 2009-05-01 18:58:46.000000000 +0200 -@@ -70,6 +70,7 @@ - // Reimplementations. - - virtual int length() const; -+ virtual int length_microseconds() const; - virtual int bitrate() const; - virtual int sampleRate() const; - virtual int channels() const; diff --git a/src/tools/taglib/taglib-1.5/src/taglib-1.5.tar.gz b/src/tools/taglib/taglib-1.5/src/taglib-1.5.tar.gz deleted file mode 100644 index e0985620b..000000000 Binary files a/src/tools/taglib/taglib-1.5/src/taglib-1.5.tar.gz and /dev/null differ diff --git a/src/tools/taglib/taglib-1.5/tmp/.keepme b/src/tools/taglib/taglib-1.5/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/tools/taglib/taglib-1.5/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/bin/autogen.sh b/src/tools/xmlrpc++/xmlrpc++-20040713/bin/autogen.sh deleted file mode 100755 index f064bcfde..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/bin/autogen.sh +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this to set up the build system: configure, makefiles, etc. -# (based on the version in enlightenment's cvs) -#------------------------------------------------------------------------------- - -package="xmlrpc++" - -# assume we're in $basedir/bin -reldir=`dirname $0`/.. -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. -usrdir=`cd $basedir/../../../../usr; pwd;` - -bindir=$basedir/bin -etcdir=$basedir/etc -tmpdir=$basedir/tmp - -cd "$tmpdir" -DIE=0 - -(autoheader --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -(autoconf --version) < /dev/null > /dev/null 2>&1 || { - echo - echo "You must have autoconf installed to compile $package." - echo "Download the appropriate package for your distribution," - echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" - DIE=1 -} - -if test "$DIE" -eq 1; then - exit 1 -fi - -if test -z "$*"; then - echo "I am going to run ./configure with no arguments - if you wish " - echo "to pass any to it, please specify them on the $0 command line." -fi - -echo "Generating configuration files for $package, please wait...." - -configure_ac=${etcdir}/configure.ac -configure=${tmpdir}/configure -aclocal_m4=${tmpdir}/aclocal.m4 - -# copy over configure.ac and acinlclude.m4 from etc to tmp, -# as aclocal >= 1.8 is sooo unbelivably stupid that it will simply try to -# look for configure.ac in the current directory, and include acinclude.m4 -# in aclocal.m4 it without a directory path in front -#ACLOCAL_FLAGS="-I ${tmpdir} --acdir=${tmpdir} --output=${aclocal_m4}" -#echo " aclocal $ACLOCAL_FLAGS" -#cp -f ${configure_ac} ${tmpdir} -#cp -f ${etcdir}/acinclude.m4 ${tmpdir} -#aclocal $ACLOCAL_FLAGS - -#echo " autoheader ${configure_ac}" -#autoheader ${configure_ac} - -echo " autoconf -I ${tmpdir} -o ${configure} ${configure_ac}" -autoconf -I ${tmpdir} -o ${configure} ${configure_ac} - diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/bin/prepare.sh b/src/tools/xmlrpc++/xmlrpc++-20040713/bin/prepare.sh deleted file mode 100755 index d7975bfa3..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/bin/prepare.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ -#------------------------------------------------------------------------------- -#------------------------------------------------------------------------------- -# Run this script to prepare xmlrpc++ to be configured and compiled. -# For more information on xmlrpc++, see http://xmlrpcpp.sourceforge.net/ -#------------------------------------------------------------------------------- -product=xmlrpc++-20040713 - -reldir=`dirname $0`/.. -basedir=`cd ${reldir}; pwd;` -bindir=${basedir}/bin -etcdir=${basedir}/etc -tmpdir=${basedir}/tmp - -tar=$basedir/src/$product.tar.gz - -mkdir -p ${tmpdir} - -cd ${tmpdir} -if [ ! -d xmlrpc++ ]; then - tar xfz ${tar} - cd xmlrpc++ - # see http://sourceforge.net/tracker/index.php?func=detail&aid=990356&group_id=70654&atid=528555 - patch -p1 < $etcdir/xmlrpc++-automake.patch - # see http://sourceforge.net/tracker/index.php?func=detail&aid=990676&group_id=70654&atid=528555 - patch -p1 < $etcdir/uninitialised_XmlRpcSource_ssl_ssl.patch - # see http://sourceforge.net/tracker/?group_id=70654&atid=528555&func=detail&aid=1085119 - patch -p1 < $etcdir/incorrect_XmlRpcValue_struct_tm_conversion.patch -fi - diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/configure b/src/tools/xmlrpc++/xmlrpc++-20040713/configure deleted file mode 100755 index 368737222..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/configure +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.campware.org/ -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# Run this script to configure the environment. -# -# This script in effect calls the real automake / autoconf configure script -#------------------------------------------------------------------------------- - -# assume we're in $basedir -reldir=`dirname $0` -basedir=`cd $reldir; pwd;` -test -z "$basedir" && basedir=. - -bindir=$basedir/bin -tmpdir=$basedir/tmp - - -autogen=$bindir/autogen.sh -configure=$tmpdir/configure - -if [ ! -x $configure ]; then - (cd $basedir && $autogen $*) -fi - -(cd $tmpdir && $configure $*) - diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/Makefile.in b/src/tools/xmlrpc++/xmlrpc++-20040713/etc/Makefile.in deleted file mode 100644 index 778068d3c..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/Makefile.in +++ /dev/null @@ -1,78 +0,0 @@ -#------------------------------------------------------------------------------- -# Copyright (c) 2010 Sourcefabric O.P.S. -# -# This file is part of the Campcaster project. -# http://campcaster.sourcefabric.org/ -# To report bugs, send an e-mail to bugs@campware.org -# -# Campcaster is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# Campcaster is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Campcaster; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# -# Author : $Author$ -# Version : $Revision$ -# Location : $URL$ -#------------------------------------------------------------------------------- - -#------------------------------------------------------------------------------- -# General command definitions -#------------------------------------------------------------------------------- -MKDIR = mkdir -p -RM = rm -f -RMDIR = rm -rf -DOXYGEN = doxygen -DOXYTAG = doxytag -XSLTPROC = xsltproc -ECHO = @echo -FLAWFINDER = flawfinder - - -#------------------------------------------------------------------------------- -# Basic directory and file definitions -#------------------------------------------------------------------------------- -BASE_DIR = . -BIN_DIR = ${BASE_DIR}/bin -DOC_DIR = ${BASE_DIR}/doc -DOXYGEN_DIR = ${DOC_DIR}/doxygen -COVERAGE_DIR = ${DOC_DIR}/coverage -ETC_DIR = ${BASE_DIR}/etc -TMP_DIR = ${BASE_DIR}/tmp - -XMLRPCXX_VERSION = xmlrpc++-20040713 -XMLRPCXX_DIR = ${TMP_DIR}/xmlrpc++ - - -#------------------------------------------------------------------------------- -# Targets -#------------------------------------------------------------------------------- -all: ${TMP_DIR}/all.stamp -${TMP_DIR}/all.stamp: - ${MAKE} -C ${XMLRPCXX_DIR} - touch ${TMP_DIR}/all.stamp - -install: all ${TMP_DIR}/install.stamp -${TMP_DIR}/install.stamp: - ${MAKE} -C ${XMLRPCXX_DIR} install - touch ${TMP_DIR}/install.stamp - -clean: - ${MAKE} -C ${XMLRPCXX_DIR} clean - ${RM} ${TMP_DIR}/*.stamp - -distclean: - ${RMDIR} ${XMLRPCXX_DIR} - ${RMDIR} ${TMP_DIR}/auto* ${TMP_DIR}/config* ${TMP_DIR}/install-sh - ${RM} ${TMP_DIR}/depcomp ${TMP_DIR}/ltmain.sh ${TMP_DIR}/missing - ${RM} ${TMP_DIR}/*.stamp - diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/configure.ac b/src/tools/xmlrpc++/xmlrpc++-20040713/etc/configure.ac deleted file mode 100644 index 9bf367a8b..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/configure.ac +++ /dev/null @@ -1,55 +0,0 @@ -dnl----------------------------------------------------------------------------- -dnl Copyright (c) 2010 Sourcefabric O.P.S. -dnl -dnl This file is part of the Campcaster project. -dnl http://campcaster.sourcefabric.org/ -dnl To report bugs, send an e-mail to bugs@campware.org -dnl -dnl Campcaster is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as published by -dnl the Free Software Foundation; either version 2 of the License, or -dnl (at your option) any later version. -dnl -dnl Campcaster is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public License -dnl along with Campcaster; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl -dnl Author : $Author$ -dnl Version : $Revision$ -dnl Location : $URL$ -dnl----------------------------------------------------------------------------- - -dnl----------------------------------------------------------------------------- -dnl NOTE: Run all configure related scripts from the tmp directory of the -dnl project. -dnl This is due to the fact that configure spreads a lot of trash around, -dnl like atom4te cache directories, config.* files, etc. into the directory -dnl it is being run from. We clearly don't want these in our base directory. -dnl----------------------------------------------------------------------------- -AC_INIT(xmlrpc++, 20040713, bugs@campware.org) -AC_PREREQ(2.59) -AC_COPYRIGHT([Copyright (c) 2010 Sourcefabric O.P.S. under the GNU GPL]) -AC_REVISION($Revision$) - -AC_CONFIG_SRCDIR(../src/xmlrpc++-20040713.tar.gz) - - -dnl untar the sources before anything happens -../bin/prepare.sh - -dnl generate autoconf environment -cd ../tmp/xmlrpc++ -sh autogen.sh --prefix=$prefix -cd - - - -AC_CONFIG_FILES(../Makefile:../etc/Makefile.in) - -AC_OUTPUT() - diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/incorrect_XmlRpcValue_struct_tm_conversion.patch b/src/tools/xmlrpc++/xmlrpc++-20040713/etc/incorrect_XmlRpcValue_struct_tm_conversion.patch deleted file mode 100644 index f0fc4cbf1..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/incorrect_XmlRpcValue_struct_tm_conversion.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff -Nur xmlrpc++/src/XmlRpcValue.cpp x/src/XmlRpcValue.cpp ---- xmlrpc++/src/XmlRpcValue.cpp 2003-06-06 20:13:28.000000000 +0200 -+++ x/src/XmlRpcValue.cpp 2004-12-13 21:02:39.505001617 +0100 -@@ -390,6 +390,7 @@ - return false; - - t.tm_year -= 1900; -+ t.tm_mon -= 1; - t.tm_isdst = -1; - _type = TypeDateTime; - _value.asTime = new struct tm(t); -@@ -402,7 +403,7 @@ - struct tm* t = _value.asTime; - char buf[20]; - snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d", -- 1900+t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec); -+ 1900+t->tm_year,1+t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec); - buf[sizeof(buf)-1] = 0; - - std::string xml = VALUE_TAG; -@@ -553,8 +554,8 @@ - { - struct tm* t = _value.asTime; - char buf[20]; -- snprintf(buf, sizeof(buf)-1, "%4d%02d%02dT%02d:%02d:%02d", -- t->tm_year,t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec); -+ snprintf(buf, sizeof(buf)-1, "%04d%02d%02dT%02d:%02d:%02d", -+ 1900+t->tm_year,1+t->tm_mon,t->tm_mday,t->tm_hour,t->tm_min,t->tm_sec); - buf[sizeof(buf)-1] = 0; - os << buf; - break; diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/uninitialised_XmlRpcSource_ssl_ssl.patch b/src/tools/xmlrpc++/xmlrpc++-20040713/etc/uninitialised_XmlRpcSource_ssl_ssl.patch deleted file mode 100644 index 4c2faa6f6..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/uninitialised_XmlRpcSource_ssl_ssl.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur xmlrpc++/src/XmlRpcSource.cpp x/src/XmlRpcSource.cpp ---- xmlrpc++/src/XmlRpcSource.cpp 2004-04-13 22:21:59.000000000 +0700 -+++ x/src/XmlRpcSource.cpp 2004-07-14 12:26:28.227768848 +0700 -@@ -9,6 +9,7 @@ - XmlRpcSource::XmlRpcSource(int fd /*= -1*/, bool deleteOnClose /*= false*/) - : _fd(fd), _deleteOnClose(deleteOnClose), _keepOpen(false) - { -+ _ssl_ssl = NULL; - } - - XmlRpcSource::~XmlRpcSource() diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/xmlrpc++-automake.patch b/src/tools/xmlrpc++/xmlrpc++-20040713/etc/xmlrpc++-automake.patch deleted file mode 100644 index 14de32d39..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/etc/xmlrpc++-automake.patch +++ /dev/null @@ -1,252 +0,0 @@ -diff -Naur xmlrpc++/Makefile xmlrpc++-automake/Makefile ---- xmlrpc++/Makefile 2004-04-19 20:53:00.000000000 +0700 -+++ xmlrpc++-automake/Makefile 1970-01-01 07:00:00.000000000 +0700 -@@ -1,71 +0,0 @@ --# makefile written for gnu make --CXX = g++ --SRC = ./src --SHARED = -shared --CPPFLAGS = -I$(SRC) --DEBUG = -g --OPTIMIZE = -O2 --GCCWARN = -Wall -Wstrict-prototypes --CXXFLAGS = $(DEBUG) $(GCCWARN) $(OPTIMIZE) $(INCLUDES) --VERSION = 0.8 -- --DESTDIR = --prefix = /usr --MKDIR = mkdir -p --CP = cp --LN = ln -s -- --LIB = ./libXmlRpc.a --LIBALT = ./libxmlrpc++.a --SO = ./libxmlrpc++.so.$(VERSION) -- --# Add your system-dependent network libs here. These are --# only used to build the tests (your application will need them too). --# Linux: none --# Solaris: -lsocket -lnsl --#SYSTEMLIBS = -lsocket -lnsl --SYSTEMLIBS = --LDLIBS = $(LIB) $(SYSTEMLIBS) -- --OBJ = $(SRC)/XmlRpcClient.o $(SRC)/XmlRpcDispatch.o \ -- $(SRC)/XmlRpcServer.o $(SRC)/XmlRpcServerConnection.o \ -- $(SRC)/XmlRpcServerMethod.o $(SRC)/XmlRpcSocket.o $(SRC)/XmlRpcSource.o \ -- $(SRC)/XmlRpcUtil.o $(SRC)/XmlRpcValue.o -- --all: $(LIB) $(SO) tests -- --$(LIB): $(OBJ) -- $(AR) $(ARFLAGS) $(LIB) $(OBJ) -- cp $(LIB) $(LIBALT) -- --$(SO): $(OBJ) -- $(CXX) -o $(SO) $(SHARED) $(OBJ) -- -- --tests: $(LIB) -- cd test && $(MAKE) CXX=$(CXX) CXXFLAGS="$(CXXFLAGS)" SYSTEMLIBS="$(SYSTEMLIBS)" -- --doc doxygen: -- cd src && doxygen Doxyfile -- --distclean: clean -- --clean: -- rm -f $(SRC)/*.o -- rm -f $(SRC)/*~ -- rm -f $(LIB) $(LIBALT) $(SO) -- rm -f build -- cd test && $(MAKE) clean -- --install: -- $(MKDIR) $(DESTDIR)$(prefix)/lib -- $(CP) $(SO) $(LIB) $(DESTDIR)$(prefix)/lib -- $(MKDIR) $(DESTDIR)$(prefix)/include -- $(CP) src/*.h $(DESTDIR)$(prefix)/include -- ( cd $(DESTDIR)$(prefix)/lib; rm -f libxmlrpc++.so; $(LN) $(SO) libxmlrpc++.so ) -- # Does not install tests right now -- --# Debian package make target, in case you want to manually build a package --# from the distribution. --deb: -- dpkg-buildpackage -rfakeroot -diff -Naur xmlrpc++/Makefile.am xmlrpc++-automake/Makefile.am ---- xmlrpc++/Makefile.am 1970-01-01 07:00:00.000000000 +0700 -+++ xmlrpc++-automake/Makefile.am 2004-07-26 11:54:16.610066768 +0700 -@@ -0,0 +1,17 @@ -+SUBDIRS = src -+ -+EXTRA_DIST = README.html -+ -+DOC_DIR=@datadir@/doc/xmlrpc++ -+ -+doc: -+ cd src && doxygen Doxyfile -+ -+install-data-local: doc -+ $(mkinstalldirs) $(DOC_DIR); \ -+ for i in doc/html/*; do \ -+ if test -r "$$i"; then \ -+ fn=`basename $$i` \ -+ $(INSTALL_DATA) $$i $(DOC_DIR)/$$fn; \ -+ fi; \ -+ done -diff -Naur xmlrpc++/autogen.sh xmlrpc++-automake/autogen.sh ---- xmlrpc++/autogen.sh 1970-01-01 07:00:00.000000000 +0700 -+++ xmlrpc++-automake/autogen.sh 2004-07-26 11:54:11.578831632 +0700 -@@ -0,0 +1,69 @@ -+#!/bin/sh -+# Run this to set up the build system: configure, makefiles, etc. -+# (based on the version in enlightenment's cvs) -+ -+package="xmlrpc++" -+ -+srcdir=`dirname $0` -+test -z "$srcdir" && srcdir=. -+ -+cd "$srcdir" -+DIE=0 -+ -+(autoheader --version) < /dev/null > /dev/null 2>&1 || { -+ echo -+ echo "You must have autoconf installed to compile $package." -+ echo "Download the appropriate package for your distribution," -+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" -+ DIE=1 -+} -+ -+(autoconf --version) < /dev/null > /dev/null 2>&1 || { -+ echo -+ echo "You must have autoconf installed to compile $package." -+ echo "Download the appropriate package for your distribution," -+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" -+ DIE=1 -+} -+ -+(automake --version) < /dev/null > /dev/null 2>&1 || { -+ echo -+ echo "You must have automake installed to compile $package." -+ echo "Download the appropriate package for your system," -+ echo "or get the source from one of the GNU ftp sites" -+ echo "listed in http://www.gnu.org/order/ftp.html" -+ DIE=1 -+} -+ -+(libtool --help) < /dev/null > /dev/null 2>&1 || { -+ echo -+ echo "You must have libtool installed to compile $package." -+ echo "Download the appropriate package for your system," -+ echo "or get the source from one of the GNU ftp sites" -+ echo "listed in http://www.gnu.org/order/ftp.html" -+ DIE=1 -+} -+ -+if test "$DIE" -eq 1; then -+ exit 1 -+fi -+ -+if test -z "$*"; then -+ echo "I am going to run ./configure with no arguments - if you wish " -+ echo "to pass any to it, please specify them on the $0 command line." -+fi -+ -+echo "Generating configuration files for $package, please wait...." -+ -+echo " aclocal $ACLOCAL_FLAGS" -+aclocal $ACLOCAL_FLAGS -+echo " autoheader" -+autoheader -+echo " libtoolize --automake" -+libtoolize --automake -+echo " automake --add-missing --foreign $AUTOMAKE_FLAGS" -+automake --add-missing --foreign $AUTOMAKE_FLAGS -+echo " autoconf" -+autoconf -+ -+$srcdir/configure "$@" && echo -diff -Naur xmlrpc++/configure.in xmlrpc++-automake/configure.in ---- xmlrpc++/configure.in 1970-01-01 07:00:00.000000000 +0700 -+++ xmlrpc++-automake/configure.in 2004-07-26 11:54:11.578831632 +0700 -@@ -0,0 +1,40 @@ -+dnl Process this file with autoconf to produce a configure script. -+AC_INIT(src/XmlRpc.h) -+ -+XMLRPC_MAJOR_VERSION=0 -+XMLRPC_MINOR_VERSION=8 -+XMLRPC_MICRO_VERSION=0 -+ -+#shared library versioning -+XMLRPC_INTERFACE_AGE=0 # increment if interfaces have been added, -+ # zero if interfaces have changed or been removed -+XMLRPC_BINARY_AGE=0 # increment if binary-compatability is broken -+ -+XMLRPC_VERSION=$XMLRPC_MAJOR_VERSION.$XMLRPC_MINOR_VERSION.$XMLRPC_MICRO_VERSION -+ -+LT_RELEASE=$XMLRPC_MAJOR_VERSION.$XMLRPC_MINOR_VERSION -+LT_CURRENT=`expr $XMLRPC_MICRO_VERSION - $XMLRPC_INTERFACE_AGE` -+LT_REVISION=$XMLRPC_INTERFACE_AGE -+LT_AGE=`expr $XMLRPC_BINARY_AGE - $XMLRPC_INTERFACE_AGE` -+ -+AC_SUBST(LT_RELEASE) -+AC_SUBST(LT_CURRENT) -+AC_SUBST(LT_REVISION) -+AC_SUBST(LT_AGE) -+AC_SUBST(XMLRPC_VERSION) -+ -+AM_INIT_AUTOMAKE(libxmlrpc++,$XMLRPC_VERSION) -+ -+AM_CONFIG_HEADER(configure.h) -+ -+AC_PROG_CXX -+AC_PROG_INSTALL -+AC_PROG_LIBTOOL -+ -+dnl AC_STDC_HEADERS -+AC_CHECK_LIB( socket, socket) -+AC_CHECK_LIB( nsl, gethostbyname) -+AC_CHECK_LIB( ssl, SSL_connect) -+ -+AC_OUTPUT(Makefile src/Makefile) -+ -diff -Naur xmlrpc++/src/Makefile.am xmlrpc++-automake/src/Makefile.am ---- xmlrpc++/src/Makefile.am 1970-01-01 07:00:00.000000000 +0700 -+++ xmlrpc++-automake/src/Makefile.am 2004-07-26 11:54:11.578831632 +0700 -@@ -0,0 +1,35 @@ -+lib_LTLIBRARIES = libxmlrpc++.la -+ -+libxmlrpc___la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -+ -+library_includedir=$(includedir) -+library_include_HEADERS = XmlRpc.h \ -+ XmlRpcServer.h \ -+ XmlRpcSocket.h \ -+ XmlRpcValue.h \ -+ XmlRpcClient.h \ -+ XmlRpcServerConnection.h \ -+ XmlRpcSource.h \ -+ XmlRpcDispatch.h \ -+ XmlRpcServerMethod.h \ -+ XmlRpcUtil.h \ -+ XmlRpcThreadedServer.h \ -+ XmlRpcException.h \ -+ XmlRpcMutex.h \ -+ XmlRpcThread.h -+ -+libxmlrpc___la_SOURCES = $(library_include_HEADERS) \ -+ base64.h \ -+ XmlRpcClient.cpp \ -+ XmlRpcServerConnection.cpp \ -+ XmlRpcSource.cpp \ -+ XmlRpcDispatch.cpp \ -+ XmlRpcServerMethod.cpp \ -+ XmlRpcUtil.cpp \ -+ XmlRpcServer.cpp \ -+ XmlRpcSocket.cpp \ -+ XmlRpcValue.cpp \ -+ XmlRpcThreadedServer.cpp \ -+ XmlRpcMutex.cpp\ -+ XmlRpcThread.cpp -+ diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/src/xmlrpc++-20040713.tar.gz b/src/tools/xmlrpc++/xmlrpc++-20040713/src/xmlrpc++-20040713.tar.gz deleted file mode 100644 index 0ee92274a..000000000 Binary files a/src/tools/xmlrpc++/xmlrpc++-20040713/src/xmlrpc++-20040713.tar.gz and /dev/null differ diff --git a/src/tools/xmlrpc++/xmlrpc++-20040713/tmp/.keepme b/src/tools/xmlrpc++/xmlrpc++-20040713/tmp/.keepme deleted file mode 100644 index e0808fa16..000000000 --- a/src/tools/xmlrpc++/xmlrpc++-20040713/tmp/.keepme +++ /dev/null @@ -1 +0,0 @@ -keep me