[Demudi-commits] r1208 - / mixxx mixxx/branches mixxx/branches/upstream mixxx/branches/upstream/current mixxx/branches/upstream/current/src

Free Ekanayaka free-guest at alioth.debian.org
Thu Apr 19 06:33:58 UTC 2007


Author: free-guest
Date: 2007-04-19 06:33:31 +0000 (Thu, 19 Apr 2007)
New Revision: 1208

Added:
   mixxx/
   mixxx/branches/
   mixxx/branches/upstream/
   mixxx/branches/upstream/current/
   mixxx/branches/upstream/current/src/
   mixxx/branches/upstream/current/src/configure
   mixxx/branches/upstream/current/src/dlgprefsound.cpp
   mixxx/branches/upstream/current/src/main.qbas
   mixxx/branches/upstream/current/src/mixxx.pro
   mixxx/branches/upstream/current/src/mixxxview.cpp
   mixxx/branches/upstream/current/src/soundsourcemp3.cpp
   mixxx/branches/upstream/current/src/wvisualwaveform.cpp
   mixxx/tags/
Log:
[svn-inject] Installing original source of mixxx

Added: mixxx/branches/upstream/current/src/configure
===================================================================
--- mixxx/branches/upstream/current/src/configure	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/configure	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,651 @@
+#!/bin/bash 
+
+#************************************************************************
+# QBASystem
+# version 0.9.7
+# Copyright (c) 2003-2004 Gianluca Romanin ( J_Zar )
+#        <j_zar_AT_users.berlios.de>
+#************************************************************************
+
+#************************************************************************
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#************************************************************************
+
+
+
+# inserting blanks...
+echo
+echo "-----------------------------------------------------------"
+
+######################### Main stage
+#
+
+# define temp files
+H_TEMP=".help_temp" 
+L_TEMP=".l_temp" 
+CONFIGURE_DEF=".configure.def" 
+SUMMARY_LOG=".summary.log" 
+
+
+# remove temp files if there are...
+rm -f $L_TEMP
+rm -f $H_TEMP
+rm -f a.out
+
+# Here set up the "help message" -------------------------
+if   test "$1" = "--help" || test "$1" = "-h"  || test "$1" = "--h";
+then
+	CONFIGURE_OPTIONS=$(cat build.definition | grep "CONFIGURE_SCRIPT_OPTIONS" -0 -w | cut -f2 -d"=" ) ;
+	CONFIGURE_FEATURES=$(cat build.definition | grep "CONFIGURE_SCRIPT_FEATURES" -0 -w | cut -f2 -d"=" ) ;
+	CONFIGURE_PACKAGES=$(cat build.definition | grep "CONFIGURE_SCRIPT_PACKAGE_LIST" -0 -w | cut -f2 -d"=" ) ;
+	
+	cat help ;
+	echo " " ;
+	
+	if [ "$CONFIGURE_OPTIONS" != "" ] ; 
+	then
+		echo " " ;
+		echo "Custom options:" ;
+		echo " " ;
+		echo "  Add a custom option to configuration with" ;
+# 		echo " " ;
+		
+		for i in $CONFIGURE_OPTIONS ; do
+			DESCRIPTION=$(cat build.definition | grep "${i}_HELP_DESCRIPTION" -0 -w | cut -f2 -d"=" ) ;
+			echo "  --$i	$DESCRIPTION" ;
+		done
+		echo " " ;
+	fi
+	
+	if [ "$CONFIGURE_FEATURES" != "" ] ; 
+	then
+		echo " " ;
+		echo "Features:" ;
+		echo " " ;
+		echo "  Enable/disable feature's related code with" ;
+# 		echo " " ;
+		
+		for i in $CONFIGURE_FEATURES ; do
+			echo "  --enable-$i" ;
+			echo "  --disable-$i" ;
+		done
+		echo " " ;
+	fi
+	
+	if [ "$CONFIGURE_PACKAGES" != "" ] ; 
+	then
+		echo " " ;
+		echo "Package custom configuration:" ;
+		echo " " ;
+		echo "  Set custom DIR for a package with" ;
+# 		echo " " ;
+		
+		for i in $CONFIGURE_PACKAGES ; do
+			echo "  --with-$i=DIR" ;
+		done
+		echo " " ;
+	fi	
+	
+	echo " " ;
+	echo "-----------------------------------------------------------" ;
+	echo "-----------------------------------------------------------" ;
+	echo " " ;
+	exit
+fi
+
+# We should locate a project file:
+# if not defined in build.definition
+# we'll retrieve by yourself.
+# If more than one then, we take only the first.
+PROJECT_FILE=$(cat build.definition | grep "PROJECT_FILE" -0 -w | cut -f2 -d"=" ) ;
+if [ "$PROJECT_FILE" = "" ] ;
+then 
+	ls *.pro 2> proj_temp 1> /dev/null ;
+	if cat proj_temp  | grep "No such file" -q ;	
+	then
+		rm -f proj_temp ;
+		echo "Can't locate a project file!" ;
+		exit 
+	else
+		ls --format=commas *.pro 1> proj_temp ;
+		PROJECT_FILE=$(cat proj_temp | cut -f1 -d",") ;
+		rm -f proj_temp ;
+	fi
+fi
+# retrieve project path 
+# KNOWN BUG: If user executes the script environment not in the src
+# dir, then script system will surely fail!
+PROJECT_PATH=$PWD ;	
+
+
+
+echo "Project file is:      $PROJECT_FILE" ;
+#echo "Project path is:      $PROJECT_PATH" ;
+
+# cleanup phase
+rm -f $CONFIGURE_DEF ;
+rm -f $SUMMARY_LOG ;
+rm -f config.h ;
+
+
+# save project path variable
+echo "PROJECT_PATH = $PROJECT_PATH" >> $CONFIGURE_DEF ;
+
+# number of arguments + 1
+NUM_OPT=$(($# + 1));
+
+# if we have arguments, we update the user friendly output...
+if [ "$NUM_OPT" != "1" ] ;
+then 
+	echo "CUSTOM_BUILD = true" >> $CONFIGURE_DEF
+fi
+
+# retrieve the project type: Qt or not Qt?
+TMP=$(cat build.definition | grep "no_qt" -0 -w) ;
+if [ "$TMP" = "" ];
+then
+	QT_PROJECT=1 ;
+fi
+
+# Init the warning configuration
+echo "CONFIG	+= warn_on" >> $CONFIGURE_DEF
+
+
+# parsing arguments-------------------------------------------->>
+for (( d=1; d<$NUM_OPT; d++ )); do
+
+	# retrieve the field $d
+	ARG=$(echo $@ | cut -f$d -d" ") ;
+	# retrieve the option
+	OPT=$(echo $ARG | cut -f1 -d"=") ;
+	# retrieve the value
+	VAL=$(echo $ARG | cut -f2- -d"=") ;
+
+	if [ "$OPT" = "--cflags" ];
+	then
+		T=""
+		for (( y=1; y<128; y++ )); do
+			# parse option value to find different subvalues
+			V=$(echo $VAL | cut -f$y -d";") ;
+			# checking to avoid duplicates or if we have finished
+			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+			then
+				break
+			fi
+			T=$V ;
+			echo "QMAKE_CFLAGS = $V" >> $CONFIGURE_DEF
+		done
+		STATUS="ok"
+	fi
+
+	if [ "$OPT" = "--cxxflags" ];
+	then
+		T=""
+		for (( y=1; y<128; y++ )); do
+			# parse option value to find different subvalues
+			V=$(echo $VAL | cut -f$y -d";") ;
+			# checking to avoid duplicates or if we have finished
+			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+			then
+				break
+			fi
+			T=$V ;
+			echo "QMAKE_CXXFLAGS = $V" >> $CONFIGURE_DEF
+		done
+		STATUS="ok"
+	fi
+
+	if [ "$OPT" = "--lflags" ];
+	then
+		T=""
+		for (( y=1; y<128; y++ )); do
+			# parse option value to find different subvalues
+			V=$(echo $VAL | cut -f$y -d";") ;
+			# checking to avoid duplicates or if we have finished
+			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+			then
+				break
+			fi
+			T=$V ;
+			echo "QMAKE_LFLAGS = $V" >> $CONFIGURE_DEF
+		done
+		STATUS="ok"
+	fi
+
+	if [ "$OPT" = "--dependency-dir" ];
+	then
+		T=""
+		for (( y=1; y<6; y++ )); do
+			# parse option value to find different subvalues
+			V=$(echo $VAL | cut -f$y -d";") ;
+			# checking to avoid duplicates or if we have finished
+			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+			then
+				break
+			fi
+			T=$V ;
+			echo "PATH$y = $V" >> $CONFIGURE_DEF
+		done
+		STATUS="ok"
+	fi
+
+
+	if [ "$OPT" = "--prefix" ];
+	then
+		echo "PREFIX = $VAL" >> $CONFIGURE_DEF
+		STATUS="ok"
+	fi
+	
+	if [ "$OPT" = "--disable-warnings" ];
+	then
+		echo "CONFIG	-= warn_on" >> $CONFIGURE_DEF
+		echo "CONFIG	+= warn_off" >> $CONFIGURE_DEF
+		STATUS="ok"
+	fi
+
+	if [ "$OPT" = "--static-link" ];
+	then
+		# correcting a wide bug ;-(
+		if [ "$VAL" == "--static-link" ];
+		then
+			VAL="1";
+		fi
+		echo "STATIC_LIBPATH = $VAL" >> $CONFIGURE_DEF
+		STATUS="ok"
+	fi
+
+	if [ "$OPT" = "--enable-debug" ];
+	then
+		echo "CONFIG += debug" >> $CONFIGURE_DEF
+		DBG=$(cat build.definition | grep "enable_config_h" -q );
+		if [ "$DBG" != "" ];
+		then
+			echo "#define	DEBUG	1" >> config.h.in
+		fi
+		STATUS="ok"
+	fi
+	
+	if echo $OPT | grep -q -e "--enable-" ;
+	then
+		V=$(echo $OPT | cut -f4 -d"-") ;
+		echo "ENABLED_FEATURES += $V" >> $CONFIGURE_DEF
+		STATUS="ok"
+	fi
+	
+	if echo $OPT | grep -q -e "--disable-" ;
+	then
+		V=$(echo $OPT | cut -f4 -d"-") ;
+		echo "DISABLED_FEATURES += $V" >> $CONFIGURE_DEF
+		STATUS="ok"
+	fi
+	
+	if echo $OPT | grep -q -e "--with-" ;
+	then
+		V=$(echo $OPT | cut -f4 -d"-") ;
+		echo "USER_DEFINED_PACKAGES += $V" >> $CONFIGURE_DEF
+		echo "${V}_PATH += $VAL" >> $CONFIGURE_DEF
+		STATUS="ok"
+	fi
+	
+	if echo $OPT | grep -q -e "--" ;
+	then
+		V=$(echo $OPT | cut -f3 -d"-") ;
+		echo $V ;
+		CONF_OPT=$(cat build.definition | grep "CONFIGURE_SCRIPT_OPTIONS" -0 -w | cut -f2 -d"=" ) ;
+		if [ "$CONF_OPT" != "" ] ; 
+		then
+			for i in $CONF_OPT ; do
+				if [ "$V" == "$i" ] ;
+				then
+					echo "PROJECT_ACTIVE_OPTIONS += $V" >> $CONFIGURE_DEF ;
+					if [ "$VAL" != "" ] ;
+					then
+						echo "${V}_OPTION_VALUE = $VAL" >> $CONFIGURE_DEF ;
+					fi
+					STATUS="ok" ;
+				fi
+			done
+		fi
+	fi
+
+# OLD DEPRECATED STUFF!! ----------------------------->>
+#	
+# 	if [ "$OPT" = "--enable-features" ];
+# 	then
+# 		T=""
+# 		for (( y=1; y<6; y++ )); do
+# 			# parse option value to find different subvalues
+# 			V=$(echo $VAL | cut -f$y -d";") ;
+# 			# checking to avoid duplicates or if we have finished
+# 			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+# 			then
+# 				break
+# 			fi
+# 			T=$V ;
+# 			echo "ENABLED_FEATURES += $V" >> $CONFIGURE_DEF
+# 		done
+# 		STATUS="ok"
+# 	fi
+# 	if [ "$OPT" = "--disable-features" ];
+# 	then
+# 		T=""
+# 		for (( y=1; y<6; y++ )); do
+# 			# parse option value to find different subvalues
+# 			V=$(echo $VAL | cut -f$y -d";") ;
+# 			# checking to avoid duplicates or if we have finished
+# 			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+# 			then
+# 				break
+# 			fi
+# 			T=$V ;
+# 			echo "DISABLED_FEATURES += $V" >> $CONFIGURE_DEF
+# 		done
+# 		STATUS="ok"
+# 	fi
+# 
+# 
+# 
+# 	if [ "$OPT" = "--libdir" ];
+# 	then
+# 		T=""
+# 		for (( y=1; y<6; y++ )); do
+# 			# parse option value to find different subvalues
+# 			V=$(echo $VAL | cut -f$y -d";") ;
+# 			# checking to avoid duplicates or if we have finished
+# 			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+# 			then
+# 				break
+# 			fi
+# 			T=$V ;
+# 			echo "LIBS += -L$V" >> $CONFIGURE_DEF
+# 		done
+# 		STATUS="ok"
+# 	fi
+#
+#
+# OLD DEPRECATED STUFF!! -----------------------------<< (END)
+
+
+	if [ "$OPT" = "--includelib" ];
+	then
+		T=""
+		for (( y=1; y<6; y++ )); do
+			# parse option value to find different subvalues
+			V=$(echo $VAL | cut -f$y -d";") ;
+			# checking to avoid duplicates or if we have finished
+			if [ "$V" = "" ] || [ "$V" = "$T" ] ;
+			then
+				break
+			fi
+			T=$V ;
+			echo "LIBS += $V" >> $CONFIGURE_DEF
+		done
+		STATUS="ok"
+	fi
+
+	
+	# if we have not parsed a valid argument
+	# we score an error...
+	if [ "$STATUS" = "ok" ];
+	then
+		STATUS="error"
+	else
+		echo
+		echo "__ Wrong parameter!"
+		echo "__ If unsure, type './configure --help'"
+		echo 
+		exit
+	fi
+done
+# parsing arguments--------------------------------------------<< (END)
+
+
+# rolling to go with qmake...
+
+######################### QT Env variables checking
+#
+if  export | grep "QTDIR" -q ;
+then
+	RES="yes"
+else
+	RES="no"
+fi
+
+echo Checking whether QTDIR is set     ........    $RES   , $QTDIR
+
+if echo $RES | grep "no" -q ;
+then
+	echo
+	echo "__ QTDIR must be properly set."
+	echo "__ Please see at http://www.trolltech.com, section developers"
+	echo "__ and find the installation instructions."
+	exit
+fi
+
+## section init: if qt project
+if [ "$QT_PROJECT" = "1" ] ;
+then
+
+	######################### Qt headers ---> qglobal.h
+	#
+	if test -f $QTDIR/include/qglobal.h ;
+	then
+		QT_GLOBAL_HEADER="$QTDIR/include/qglobal.h" ;
+		RES="yes"
+	else
+		find /usr -name qglobal.h 1> temp ;
+		QT_GLOBAL_HEADER=$(cat temp) ;
+		if [ "$QT_GLOBAL_HEADER" != "" ]
+		then
+			RES="yes"
+		else
+			RES="no"
+		fi
+	fi
+	
+	echo Checking for Qt headers    ........    $RES
+	
+	if test "$RES" = "no" ;
+	then
+		echo
+		echo "__ I can't locate Qt headers. Just tried: $QTDIR/include"
+		echo "__ If your headers are located in another path, please send a"
+		echo "__ bug report to the QBAS developers ( http://qbas.berlios.de )."
+		exit
+	fi
+	
+	
+	
+	######################### QT Version >= $QT_MINIMUM_REQUIRED_VERSION (if it is set)
+	#
+	
+	QT_MINIMUM_REQUIRED_VERSION=$(cat build.definition | grep "QT_MINIMUM_REQUIRED_VERSION" -0 -w | cut -f2 -d"=" ) ;
+	QT_MINIMUM_REQUIRED_VERSION_STR=$(cat build.definition | grep "QT_MINIMUM_REQUIRED_VERSION_STR" -0 -w | cut -f2 -d"=" ) ;
+	
+	if [ "$QT_MINIMUM_REQUIRED_VERSION" != "" ] && [ "$QT_MINIMUM_REQUIRED_VERSION_STR" != "" ];
+	then
+		cat $QT_GLOBAL_HEADER | grep "QT_VERSION" -0 > temp ; 
+		QVERSION=$(cat temp | grep "#define QT_VERSION" -0 -w | cut -f3 -d" " | cut -f2 -d"x") ;
+		QVERSION_STR=$(cat temp | grep "QT_VERSION_STR" -0 -w | cut -f2 -d'"') ;
+	
+		if test $QVERSION -ge $QT_MINIMUM_REQUIRED_VERSION  ;
+		then 
+			RES="yes"
+		else
+			RES="no"
+		fi
+	
+		rm -f temp ;
+	
+		echo Checking if Qt \>\= $QT_MINIMUM_REQUIRED_VERSION_STR    ........    $RES   , $QVERSION_STR
+	
+		if echo $RES | grep "no" -q ;
+		then
+			echo
+			echo "__ Incorrect Qt version!"
+			exit
+		fi
+	fi
+	
+	
+	
+	######################### QT library is thread type?
+	#
+	if test -e $QTDIR/lib/libqt-mt.so ;
+	then
+		QT_LIB="$QTDIR/lib" ;
+		RES="yes"
+		echo "CONFIG += thread" >> $CONFIGURE_DEF ;
+	else
+		find /usr -name libqt-mt.so 1> temp ;
+		QT_LIB=$(cat temp) ;
+		if [ "$QT_LIB" != "" ]
+		then
+			RES="yes"
+			echo "CONFIG += thread" >> $CONFIGURE_DEF ;
+			
+			echo
+			echo "__ Qt lib not in the expected path!"
+			echo
+			
+			CRITICAL="1" ;
+		else
+			RES="no"
+		fi
+	fi
+	
+	echo Checking if Qt is -mt    ........    $RES 
+	
+	fi # end if !no_qt
+	
+	
+	######################### qmake, uic, moc checking
+	#
+	if test -e $QTDIR/bin/qmake ;
+	then
+		QT_QMAKE_EXEC="$QTDIR/bin/qmake" ;
+		RES="yes"
+	else
+		find /usr -name qmake 1> temp ;
+		QT_QMAKE_EXEC=$(cat temp) ;
+		if [ "$QT_QMAKE_EXEC" != "" ]
+		then
+			RES="yes"
+			echo
+			echo "__ qmake not in the expected path!"
+			echo
+			
+			CRITICAL="1" ;
+		else
+			RES="no"
+		fi
+	fi
+	
+	echo Checking for qmake    ........    $RES , $QT_QMAKE_EXEC
+	
+	if test "$RES" = "no" ;
+	then
+		echo
+		echo "__ I can't locate qmake."
+		exit
+	fi
+	
+	## section init: if qt project
+	if [ "$QT_PROJECT" = "1" ] ;
+	then
+	
+	if test -e $QTDIR/bin/uic ;
+	then
+		QT_UIC_EXEC="$QTDIR/bin/uic" ;
+		RES="yes"
+	else
+		find /usr -name uic 1> temp ;
+		QT_UIC_EXEC=$(cat temp) ;
+		if [ "$QT_UIC_EXEC" != "" ]
+		then
+			RES="yes"
+			echo
+			echo "__ uic not in the expected path!"
+			echo
+			
+			CRITICAL="1" ;
+		else
+			RES="no"
+		fi
+	fi
+	
+	echo Checking for uic    ........    $RES , $QT_UIC_EXEC 
+	
+	if test "$RES" = "no" ;
+	then
+		echo
+		echo "__ I can't locate uic."
+		exit
+	fi
+	
+	if test -e $QTDIR/bin/moc ;
+	then
+		QT_MOC_EXEC="$QTDIR/bin/moc" ;
+		RES="yes"
+	else
+		find /usr -name moc 1> temp ;
+		QT_MOC_EXEC=$(cat temp) ;
+		if [ "$QT_MOC_EXEC" != "" ]
+		then
+			RES="yes"
+			echo
+			echo "__ moc not in the expected path!"
+			echo
+			
+			CRITICAL="1" ;
+		else
+			RES="no"
+		fi
+	fi
+	
+	echo Checking for moc    ........    $RES , $QT_MOC_EXEC
+	
+	if test "$RES" = "no" ;
+	then
+		echo
+		echo "__ I can't locate moc."
+		exit
+	fi
+
+fi # end if !no_qt
+
+
+
+
+if [ "$CRITICAL" = "1" ] ;
+then 
+	echo
+	echo "__ Critical exceptions occurred."
+	echo "__ Check errors above if something goes wrong..."
+	echo 
+fi
+
+#cleanup
+rm -f temp ;
+
+
+echo "-------------------------------------------"
+echo    Now going with qmake...
+echo "-------------------------------------------"
+
+$QT_QMAKE_EXEC $PROJECT_FILE
+


Property changes on: mixxx/branches/upstream/current/src/configure
___________________________________________________________________
Name: svn:executable
   + 

Added: mixxx/branches/upstream/current/src/dlgprefsound.cpp
===================================================================
--- mixxx/branches/upstream/current/src/dlgprefsound.cpp	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/dlgprefsound.cpp	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,267 @@
+/***************************************************************************
+                          dlgprefsound.cpp  -  description
+                             -------------------
+    begin                : Thu Apr 17 2003
+    copyright            : (C) 2003 by Tue & Ken Haste Andersen
+    email                : haste at diku.dk
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "dlgprefsound.h"
+#include "playerproxy.h"
+#include <qcombobox.h>
+#include <qpushbutton.h>
+#include <qslider.h>
+#include <qlabel.h>
+#include <qmessagebox.h>
+#include <qthread.h>
+
+DlgPrefSound::DlgPrefSound(QWidget *parent, PlayerProxy *_player,
+                           ConfigObject<ConfigValue> *_config) : DlgPrefSoundDlg(parent,"")
+{
+    m_bLatencySliderDrag = false;
+    player = _player;
+    config = _config;
+
+    // Update of latency label, when latency slider is updated
+    connect(SliderLatency,                SIGNAL(sliderMoved(int)),  this, SLOT(slotLatency()));
+    connect(SliderLatency,                SIGNAL(sliderReleased()),  this, SLOT(slotLatency()));
+    connect(SliderLatency,                SIGNAL(valueChanged(int)), this, SLOT(slotLatency()));
+
+    // Set default sound quality as stored in config file if not already set
+    if (config->getValueString(ConfigKey("[Soundcard]","SoundQuality")).length() == 0)
+        config->set(ConfigKey("[Soundcard]","SoundQuality"),ConfigValue(4));
+
+    // Sound quality slider updates
+    SliderSoundQuality->setValue(2+4-config->getValueString(ConfigKey("[Soundcard]","SoundQuality")).toInt());
+
+    // Apply changes whenever apply signal is emitted
+    connect(ComboBoxSoundcardMasterLeft,  SIGNAL(activated(int)),    this, SLOT(slotApply()));
+    connect(ComboBoxSoundcardMasterRight, SIGNAL(activated(int)),    this, SLOT(slotApply()));
+    connect(ComboBoxSoundcardHeadLeft,    SIGNAL(activated(int)),    this, SLOT(slotApply()));
+    connect(ComboBoxSoundcardHeadRight,   SIGNAL(activated(int)),    this, SLOT(slotApply()));
+    connect(ComboBoxSamplerates,          SIGNAL(activated(int)),    this, SLOT(slotApply()));
+    connect(ComboBoxSoundApi,             SIGNAL(activated(int)),    this, SLOT(slotApplyApi()));
+    connect(SliderLatency,                SIGNAL(sliderPressed()),   this, SLOT(slotLatencySliderClick()));
+    connect(SliderLatency,                SIGNAL(sliderReleased()),  this, SLOT(slotLatencySliderRelease()));
+    connect(SliderLatency,                SIGNAL(valueChanged(int)), this, SLOT(slotLatencySliderChange(int)));
+    connect(SliderSoundQuality,           SIGNAL(valueChanged(int)), this, SLOT(slotApply()));
+
+    // Connect timer to latency query slot
+    connect(&m_qTimer, SIGNAL(timeout()), this, SLOT(slotQueryLatency()));
+}
+
+DlgPrefSound::~DlgPrefSound()
+{
+}
+
+void DlgPrefSound::slotUpdate()
+{
+    QStringList interfaces = player->getInterfaces();
+    QStringList::iterator it;
+    int j;
+
+    // Master left sound card info
+    ComboBoxSoundcardMasterLeft->clear();
+    ComboBoxSoundcardMasterLeft->insertItem("None");
+    it = interfaces.begin();
+    j = 1;
+    while ((*it))
+    {
+        ComboBoxSoundcardMasterLeft->insertItem((*it));
+        if ((*it)==config->getValueString(ConfigKey("[Soundcard]","DeviceMasterLeft")))
+            ComboBoxSoundcardMasterLeft->setCurrentItem(j);
+        ++j;
+        ++it;
+    }
+
+    // Master right sound card info
+    ComboBoxSoundcardMasterRight->clear();
+    ComboBoxSoundcardMasterRight->insertItem("None");
+    it = interfaces.begin();
+    j = 1;
+    while ((*it))
+    {
+        ComboBoxSoundcardMasterRight->insertItem((*it));
+        if ((*it)==config->getValueString(ConfigKey("[Soundcard]","DeviceMasterRight")))
+            ComboBoxSoundcardMasterRight->setCurrentItem(j);
+        ++j;
+        ++it;
+    }
+
+    // Head left sound card info
+    ComboBoxSoundcardHeadLeft->clear();
+    ComboBoxSoundcardHeadLeft->insertItem("None");
+    it = interfaces.begin();
+    j = 1;
+    while ((*it))
+    {
+        ComboBoxSoundcardHeadLeft->insertItem((*it));
+        if ((*it)==config->getValueString(ConfigKey("[Soundcard]","DeviceHeadLeft")))
+            ComboBoxSoundcardHeadLeft->setCurrentItem(j);
+        ++j;
+        ++it;
+    }
+
+    // Head right sound card info
+    ComboBoxSoundcardHeadRight->clear();
+    ComboBoxSoundcardHeadRight->insertItem("None");
+    it = interfaces.begin();
+    j = 1;
+    while ((*it))
+    {
+        ComboBoxSoundcardHeadRight->insertItem((*it));
+        if ((*it)==config->getValueString(ConfigKey("[Soundcard]","DeviceHeadRight")))
+            ComboBoxSoundcardHeadRight->setCurrentItem(j);
+        ++j;
+        ++it;
+    }
+
+    // Sample rate
+    ComboBoxSamplerates->clear();
+    QStringList srates = player->getSampleRates();
+    it = srates.begin();
+    j = 0;
+    while ((*it))
+    {
+        ComboBoxSamplerates->insertItem((*it));
+        if ((*it)==config->getValueString(ConfigKey("[Soundcard]","Samplerate")))
+            ComboBoxSamplerates->setCurrentItem(j);
+        ++j;
+        ++it;
+    }
+
+    // Latency
+    SliderLatency->setValue(getSliderLatencyVal(config->getValueString(ConfigKey("[Soundcard]","Latency")).toInt()));
+
+    // API's
+    ComboBoxSoundApi->clear();
+    ComboBoxSoundApi->insertItem("None");
+    QStringList api = player->getSoundApiList();
+    it = api.begin();
+    j = 1;
+    while ((*it))
+    {
+        ComboBoxSoundApi->insertItem((*it));
+        if ((*it)==config->getValueString(ConfigKey("[Soundcard]","SoundApi")))
+            ComboBoxSoundApi->setCurrentItem(j);
+        ++j;
+        ++it;
+    }
+}
+
+void DlgPrefSound::slotLatency()
+{
+    TextLabelLatency->setText(QString("%1 ms").arg(getSliderLatencyMsec(SliderLatency->value())));
+}
+
+int DlgPrefSound::getSliderLatencyMsec(int val)
+{
+    if (val>16)
+        val = (val-12)*(val-12);
+    return val;
+}
+
+int DlgPrefSound::getSliderLatencyVal(int val)
+{
+    if (val<=16)
+        return val;
+
+    int i=5;
+    while (i*i<val)
+        i++;
+    return 12+i;
+}
+
+void DlgPrefSound::slotApply()
+{
+    qDebug("Apply");
+
+    // Update the config object with parameters from dialog
+    config->set(ConfigKey("[Soundcard]","DeviceMasterLeft"), ConfigValue(ComboBoxSoundcardMasterLeft->currentText()));
+    config->set(ConfigKey("[Soundcard]","DeviceMasterRight"), ConfigValue(ComboBoxSoundcardMasterRight->currentText()));
+    config->set(ConfigKey("[Soundcard]","DeviceHeadLeft"), ConfigValue(ComboBoxSoundcardHeadLeft->currentText()));
+    config->set(ConfigKey("[Soundcard]","DeviceHeadRight"), ConfigValue(ComboBoxSoundcardHeadRight->currentText()));
+
+    QString temp = ComboBoxSamplerates->currentText();
+    //temp.truncate(temp.length()-3);
+    config->set(ConfigKey("[Soundcard]","Samplerate"), ConfigValue(temp));
+    //config->set(ConfigKey("[Soundcard]","Bits"), ConfigValue(ComboBoxBits->currentText()));
+    config->set(ConfigKey("[Soundcard]","Latency"), ConfigValue(getSliderLatencyMsec(SliderLatency->value())));
+    config->set(ConfigKey("[Soundcard]","SoundQuality"), ConfigValue(2+4-SliderSoundQuality->value()));
+ 
+    qDebug("request msec %i", getSliderLatencyMsec(SliderLatency->value()));
+    
+    // Close devices, and open using config data
+    player->close();
+
+    if (config->getValueString(ConfigKey("[Soundcard]","SoundApi"))=="None" || !player->open())
+        QMessageBox::warning(0, "Configuration error","Audio device could not be opened");
+    else
+    {
+        // Because the latency value configured with PortAudio, is not necessary what is actually
+        // used, it is read again 500 msec after the open
+        m_qTimer.start(500, true);
+        
+        // Configuration values might have changed after the opening of the player,
+        // so ensure the form is updated...
+        slotUpdate();
+    }
+    
+}
+
+void DlgPrefSound::slotQueryLatency()
+{
+    int iLatencyMsec = (int)ceil(1000.*((float)Player::getBufferSize()/((float)EngineObject::getPlaySrate()*2.)));
+    qDebug("got latency msec %i, buffer size %i",iLatencyMsec,Player::getBufferSize());
+    
+    // Only correct latency slider if it's more than two milliseconds off the actual value.
+    // By changing the latency sliders value, the device is closed and opened again, and this
+    // function will thus be called again, resulting in a loop
+    if (config->getValueString(ConfigKey("[Soundcard]","SoundApi"))!="None" &&
+        abs(iLatencyMsec-config->getValueString(ConfigKey("[Soundcard]","Latency")).toInt())>2)
+    {
+        config->set(ConfigKey("[Soundcard]","Latency"), ConfigValue(iLatencyMsec));
+        slotUpdate();
+    }
+}
+
+void DlgPrefSound::slotApplyApi()
+{
+    config->set(ConfigKey("[Soundcard]","SoundApi"), ConfigValue(ComboBoxSoundApi->currentText()));
+    if (!player->setSoundApi(ComboBoxSoundApi->currentText()))
+    {
+        QMessageBox::warning(0, "Configuration problem","Sound API could not be initialized");
+        config->set(ConfigKey("[Soundcard]","SoundApi"), ConfigValue("None"));
+    }
+    else if (!player->open())
+        QMessageBox::warning(0, "Configuration error","Audio device could not be opened");
+
+    slotUpdate();
+}
+
+void DlgPrefSound::slotLatencySliderClick()
+{
+    m_bLatencySliderDrag = true;
+}
+
+void DlgPrefSound::slotLatencySliderRelease()
+{
+    m_bLatencySliderDrag = false;
+    slotApply();
+}
+
+void DlgPrefSound::slotLatencySliderChange(int)
+{
+    if (!m_bLatencySliderDrag)
+        slotApply();
+}
+

Added: mixxx/branches/upstream/current/src/main.qbas
===================================================================
--- mixxx/branches/upstream/current/src/main.qbas	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/main.qbas	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,69 @@
+
+#************************************************************************
+# QBASystem
+# version 0.9.7
+# Copyright (c) 2003-2004 Gianluca Romanin ( J_Zar )
+#        <j_zar_AT_users.berlios.de>
+#************************************************************************
+
+
+#************************************************************************
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#************************************************************************
+
+
+# --------------------------------------------------
+# Paths         (DON'T TOUCH!)
+include( paths.qbas )
+# --------------------------------------------------
+
+# If we don't have a debug build, set 'release' optimization...
+!contains( CONFIG, debug ) {
+	CONFIG += release
+}
+
+# --------------------------------------------------
+# Depend definitions         (DON'T TOUCH!)
+include( build.definition )
+# --------------------------------------------------
+
+# close the summary output then print it...
+contains( PROJECT_SETTINGS , enable_summary ) {
+		system( echo " " >>   $$SUMMARY_LOG )
+		system( echo "	--------------------------------------" >> $$SUMMARY_LOG )
+		system( echo " " >>  $$SUMMARY_LOG )
+		system( cat  $$SUMMARY_LOG )
+	}
+# if we don't have a Qt project, try to unlink Qt libs...
+# KNOWN BUG: this code is bypassed by Qmake so does not work!
+contains( PROJECT_SETTINGS , no_qt ) {
+		LIBS -= -lqt-mt
+		LIBS -= -lqt
+	}
+
+
+
+# ************************************************* FOOTER
+# End of transmissions!  End messages before qmake processes Makefile ...           (TOUCH!)
+message("-------------------------------------------")
+message(" Check all done...")
+message("-------------------------------------------")
+message(" Generating Makefile...")
+message("-------------------------------------------")
+message(" Next is: make && make install ")
+
+}


Property changes on: mixxx/branches/upstream/current/src/main.qbas
___________________________________________________________________
Name: svn:executable
   + 

Added: mixxx/branches/upstream/current/src/mixxx.pro
===================================================================
--- mixxx/branches/upstream/current/src/mixxx.pro	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/mixxx.pro	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,307 @@
+#
+# Qmake file for Mixxx.
+#
+# (C) 2002-2004 Tue Haste Andersen <haste at diku.dk>
+#
+# Unix dependency code and configure script by Gianluca Romanin. See included
+# files for copyright details.
+#
+
+#
+# Options, and path to libraries
+#
+
+# Include for unix dependencies. (19/12/2003, J_Zar)
+unix:!macx:include( main.qbas )
+
+# Path to Macintosh libraries
+macx:MACLIBPATH = ../../mixxx-maclib
+
+# Path to Windows libraries
+win32:WINLIBPATH = ../../mixxx-winlib
+
+# Path to ASIO SDK
+ASIOSDK_DIR   = $$WINLIBPATH/asiosdk2
+
+#
+# End of options
+#
+
+# PortAudio
+DEFINES += __PORTAUDIO__
+SOURCES += playerportaudio.cpp
+HEADERS += playerportaudio.h
+PORTAUDIO_DIR = ../lib/portaudio-v18
+INCLUDEPATH += $$PORTAUDIO_DIR/pa_common
+HEADERS += $$PORTAUDIO_DIR/pa_common/portaudio.h
+unix {
+SOURCES += $$PORTAUDIO_DIR/pa_common/pa_lib.c $$PORTAUDIO_DIR/pa_common/pa_convert.c
+HEADERS += $$PORTAUDIO_DIR/pa_common/pa_host.h
+unix:!macx:SOURCES += $$PORTAUDIO_DIR/pablio/ringbuffer.c $$PORTAUDIO_DIR/pa_unix_oss/pa_unix.c $$PORTAUDIO_DIR/pa_unix_oss/pa_unix_oss.c
+unix:!macx:HEADERS += $$PORTAUDIO_DIR/pablio/ringbuffer.h $$PORTAUDIO_DIR/pa_unix_oss/pa_unix.h
+unix:!macx:INCLUDEPATH += $$PORTAUDIO_DIR/pa_unix_oss
+macx:SOURCES += $$PORTAUDIO_DIR/pablio/ringbuffer.c $$PORTAUDIO_DIR/pa_mac_core/pa_mac_core.c
+macx:LIBS += -framework CoreAudio -framework AudioToolbox
+macx:INCLUDEPATH += $$PORTAUDIO_DIR/pa_mac_core $$PORTAUDIO_DIR/pablio 
+}
+win32 {
+    message("Compiling with PortAudio/WMME drivers")
+    LIBS += winmm.lib PAStaticWMME.lib
+}
+
+# RTAudio (Windows DirectSound)
+win32 {
+    message("Compiling with RtAudio/DirectSound drivers")
+    DEFINES += __RTAUDIO__ __WINDOWS_DS__
+    RTAUDIO_DIR = ../lib/rtaudio
+    INCLUDEPATH += $$RTAUDIO_DIR
+    HEADERS += playerrtaudio.h $$RTAUDIO_DIR/RtAudio.h $$RTAUDIO_DIR/RtError.h
+    SOURCES += playerrtaudio.cpp $$RTAUDIO_DIR/RtAudio.cpp
+    LIBS += dsound.lib
+}
+
+# ASIO (Windows)
+#win32 {
+#    DEFINES += __ASIO__
+#    SOURCES += playerasio.cpp $$ASIOSDK_DIR/common/asio.cpp $$ASIOSDK_DIR/host/asiodrivers.cpp $$ASIOSDK_DIR/host/pc/asiolist.cpp
+#    HEADERS += playerasio.h $$ASIOSDK_DIR/common/asio.h $$ASIOSDK_DIR/host/asiodrivers.h $$ASIOSDK_DIR/host/pc/asiolist.h
+#    INCLUDEPATH += $$ASIOSDK_DIR/common $$ASIOSDK_DIR/host $$ASIOSDK_DIR/host/pc
+#}
+
+# RTAudio (Linux ALSA)
+#unix:!macx {
+#    DEFINES += __RTAUDIO__ __LINUX_ALSA__
+#    RTAUDIO_DIR = ../lib/rtaudio
+#    INCLUDEPATH += $$RTAUDIO_DIR
+#    HEADERS += playerrtaudio.h $$RTAUDIO_DIR/RtAudio.h $$RTAUDIO_DIR/RtError.h
+#    SOURCES += playerrtaudio.cpp $$RTAUDIO_DIR/RtAudio.cpp
+#    LIBS += -lasound 
+#}
+
+# OSS Midi (Working good, Linux specific)
+unix:!macx:SOURCES += midiobjectoss.cpp
+unix:!macx:HEADERS += midiobjectoss.h
+unix:!macx:DEFINES += __OSSMIDI__
+
+# Windows MIDI
+win32:SOURCES += midiobjectwin.cpp
+win32:HEADERS += midiobjectwin.h
+win32:DEFINES += __WINMIDI__
+
+# CoreMidi (Mac OS X)
+macx:SOURCES += midiobjectcoremidi.cpp
+macx:HEADERS += midiobjectcoremidi.h
+macx:DEFINES += __COREMIDI__
+macx:LIBS    += -framework CoreMIDI -framework CoreFoundation
+
+# ALSA PCM (Not currently working, Linux specific)
+#SOURCES += playeralsa.cpp
+#HEADERS += playeralsa.h
+#DEFINES += __ALSA__
+#unix:LIBS += -lasound
+
+# ALSA MIDI (Not currently working, Linux specific)
+#SOURCES += midiobjectalsa.cpp
+#HEADERS += midiobjectalsa.h
+#DEFINES  += __ALSAMIDI__
+
+# Visuals
+SOURCES += wvisualsimple.cpp wvisualwaveform.cpp visual/visualbackplane.cpp visual/texture.cpp visual/visualbox.cpp visual/visualbuffer.cpp visual/visualbuffersignal.cpp visual/visualbuffersignalhfc.cpp visual/visualbuffermarks.cpp visual/visualchannel.cpp visual/visualcontroller.cpp visual/visualdisplay.cpp visual/visualdisplaybuffer.cpp visual/light.cpp visual/material.cpp visual/picking.cpp visual/pickable.cpp visual/visualobject.cpp
+HEADERS += wvisualsimple.h wvisualwaveform.h visual/visualbackplane.h  visual/texture.h visual/visualbox.h visual/visualbuffer.h visual/visualbuffersignal.h visual/visualbuffersignalhfc.h visual/visualbuffermarks.h visual/visualchannel.h visual/visualcontroller.h visual/visualdisplay.h visual/visualdisplaybuffer.h visual/light.h visual/material.h visual/picking.h visual/pickable.h visual/visualobject.h
+CONFIG += opengl
+
+# MP3
+win32:LIBS += libmad-release.lib libid3tag-release.lib
+macx:LIBS += $$MACLIBPATH/lib/libmad.a $$MACLIBPATH/lib/libid3tag.a
+
+# MP3 vbrheadersdk from Xing Technology
+INCLUDEPATH += ../lib/vbrheadersdk
+SOURCES += ../lib/vbrheadersdk/dxhead.c
+HEADERS += ../lib/vbrheadersdk/dxhead.h
+
+# Wave files
+win32:SOURCES += soundsourcesndfile.cpp
+win32:HEADERS += soundsourcesndfile.h
+win32:DEFINES += __SNDFILE__
+win32:LIBS += libsndfile.lib
+macx:SOURCES += soundsourceaudiofile.cpp
+macx:HEADERS += soundsourceaudiofile.h
+macx:DEFINES += __AUDIOFILE__
+macx:LIBS += $$MACLIBPATH/lib/libaudiofile.a
+
+# Ogg Vorbis
+win32:LIBS += vorbisfile_static.lib vorbis_static.lib ogg_static.lib
+macx:LIBS += $$MACLIBPATH/lib/libvorbis.a $$MACLIBPATH/lib/libvorbisfile.a $$MACLIBPATH/lib/libogg.a
+
+# PowerMate
+SOURCES += powermate.cpp
+HEADERS += powermate.h
+unix:!macx:SOURCES += powermatelinux.cpp
+unix:!macx:HEADERS += powermatelinux.h
+win32:SOURCES += powermatewin.cpp
+win32:HEADERS += powermatewin.h
+win32:LIBS += setupapi.lib
+
+# Mouse
+SOURCES += mouse.cpp
+HEADERS += mouse.h
+unix:!macx:SOURCES += mouselinux.cpp
+unix:!macx:HEADERS += mouselinux.h
+#win32:SOURCES += mousewin.cpp
+#win32:HEADERS += mousewin.h
+
+# Joystick
+SOURCES += joystick.cpp
+HEADERS += joystick.h
+unix:!macx:SOURCES += joysticklinux.cpp
+unix:!macx:HEADERS += joysticklinux.h
+
+# KissFFT
+KISSFFT_DIR = ../lib/kissfft
+SOURCES += $$KISSFFT_DIR/kiss_fft.c $$KISSFFT_DIR/kiss_fftr.c
+HEADERS += $$KISSFFT_DIR/kiss_fft.h $$KISSFFT_DIR/kiss_fftr.h $$KISSFFT_DIR/_kiss_fft_guts.h 
+INCLUDEPATH += $$KISSFFT_DIR
+
+# Audio scaling
+INCLUDEPATH += ../lib/libsamplerate
+SOURCES += enginebufferscalesrc.cpp ../lib/libsamplerate/samplerate.c ../lib/libsamplerate/src_linear.c ../lib/libsamplerate/src_sinc.c ../lib/libsamplerate/src_zoh.c
+HEADERS += enginebufferscalesrc.h ../lib/libsamplerate/samplerate.h ../lib/libsamplerate/config.h ../lib/libsamplerate/common.h ../lib/libsamplerate/float_cast.h ../lib/libsamplerate/fastest_coeffs.h ../lib/libsamplerate/high_qual_coeffs.h ../lib/libsamplerate/mid_qual_coeffs.h
+
+# Debug plotting through gplot API
+#unix:DEFINES += __GNUPLOT__
+#unix:INCLUDEPATH += ../lib/gplot
+#unix:SOURCES += ../lib/gplot/gplot3.c
+#unix:HEADERS += ../lib/gplot/gplot.h
+
+unix:!macx {
+  # If Intel compiler is used, set icc optimization flags
+  COMPILER = $$system(echo $QMAKESPEC)
+  contains(COMPILER, linux-icc) {
+    message("Using Intel compiler")
+#    QMAKE_CXXFLAGS += -rcd -tpp6 -xiMK # icc pentium III
+#    QMAKE_CXXFLAGS += -rcd -tpp7 -xiMKW # icc pentium IV
+#    QMAKE_CXXFLAGS += -prof_gen # generete profiling
+#    QMAKE_CXXFLAGS += -prof_use # use profiling
+    QMAKE_CXXFLAGS += -w1 #-Wall
+    # icc Profiling
+    QMAKE_CXXFLAGS_DEBUG += -qp -g
+    QMAKE_LFLAGS_DEBUG += -qp -g
+  }
+
+  # if PREFIX is defined by the user, we use it! ( 19/12/2003, J_Zar)
+  isEmpty( PREFIX ) {
+    PREFIX = /usr
+  }
+  UNIX_SHARE_PATH = $${PREFIX}/share/mixxx
+  DEFINES += UNIX_SHARE_PATH=\"$$UNIX_SHARE_PATH\"
+
+  SETTINGS_FILE = \".mixxx.cfg\"
+  TRACK_FILE = \".mixxxtrack.xml\"
+  DEFINES += __LINUX__
+}
+
+unix {
+  DEFINES += __UNIX__
+  INCLUDEPATH += .
+  UI_DIR = .ui
+  MOC_DIR = .moc
+  OBJECTS_DIR = .obj
+
+# GCC Compiler optimization flags
+#  QMAKE_CXXFLAGS += -pg -march=pentium3 -O3 -pipe
+#  QMAKE_CFLAGS   += -pg -march=pentium3 -O3 -pipe
+
+# gcc Profiling
+#QMAKE_CXXFLAGS += -pg
+#QMAKE_LFLAGS += -pg
+}
+
+win32 {
+  DEFINES += __WIN__
+  INCLUDEPATH += $$WINLIBPATH ../lib .
+  QMAKE_CXXFLAGS += -GX
+  QMAKE_LFLAGS += /VERBOSE:LIB /LIBPATH:$$WINLIBPATH /NODEFAULTLIB:library /NODEFAULTLIB:libcd /NODEFAULTLIB:libcmt /NODEFAULTLIB:libc
+  SETTINGS_FILE = \"mixxx.cfg\"
+  TRACK_FILE = \"mixxxtrack.xml\"
+  RC_FILE = mixxx.rc
+}
+
+macx {
+  DEFINES += __MACX__
+  INCLUDEPATH += $$MACLIBPATH/include
+  LIBS += -lz -framework Carbon -framework QuickTime
+  SETTINGS_FILE = \"mixxx.cfg\"
+  TRACK_FILE = \"mixxxtrack.xml\"
+  RC_FILE = icon.icns
+  QMAKE_CXXFLAGS += -O3 -faltivec -mtune=G4 -mcpu=G4 -mdynamic-no-pic -funroll-loops -ffast-math -fstrict-aliasing
+  QMAKE_CFLAGS += -O3 -faltivec -mtune=G4 -mcpu=G4 -mdynamic-no-pic -funroll-loops -ffast-math -fstrict-aliasing
+  QMAKE_LFLAGS += -O3 -faltivec -mtune=G4 -mcpu=G4 -mdynamic-no-pic -funroll-loops -ffast-math -fstrict-aliasing
+}
+
+# Install-phase for a traditional 'make install'
+unix {
+
+    # skins... (copy all)
+   skino.path = $${UNIX_SHARE_PATH}/skins/outline
+   skino.files = skins/outline/*
+   skinoc.path = $${UNIX_SHARE_PATH}/skins/outlineClose
+   skinoc.files = skins/outlineClose/*
+   skinos.path = $${UNIX_SHARE_PATH}/skins/outlineSmall
+   skinos.files = skins/outlineSmall/*
+   skint.path = $${UNIX_SHARE_PATH}/skins/traditional
+   skint.files = skins/traditional/*
+
+    # midi conf... (copy all)
+   midi.path = $${UNIX_SHARE_PATH}/midi
+   midi.files = midi/*
+
+    # keyboard conf... (copy all)
+   keyb.path = $${UNIX_SHARE_PATH}/keyboard
+   keyb.files = keyboard/*
+
+    # doc files...
+   readme.path = $${PREFIX}/share/doc/mixxx-1.3
+   readme.files = ../README
+   licence.path = $${PREFIX}/share/doc/mixxx-1.3
+   licence.files = ../LICENSE
+   copying.path = $${PREFIX}/share/doc/mixxx-1.3
+   copying.files = ../COPYING
+   manual.path = $${PREFIX}/share/doc/mixxx-1.3
+   manual.files = ../Mixxx-Manual.pdf
+
+
+    # binary...
+   TARGET = mixxx
+   target.path = $${PREFIX}/bin
+
+    # finally adding what we wanna install...
+   INSTALLS += skino skinoc skinos skint midi keyb readme licence copying manual target
+}
+
+
+FORMS	= dlgprefsounddlg.ui dlgprefmididlg.ui dlgprefplaylistdlg.ui dlgprefcontrolsdlg.ui
+
+SOURCES += mixxxmenuplaylists.cpp trackplaylistlist.cpp mixxxkeyboard.cpp configobject.cpp fakemonitor.cpp controlobjectthread.cpp controlobjectthreadwidget.cpp controlobjectthreadmain.cpp controlevent.cpp controllogpotmeter.cpp controlobject.cpp controlnull.cpp controlpotmeter.cpp controlpushbutton.cpp controlttrotary.cpp controlbeat.cpp dlgpreferences.cpp dlgprefsound.cpp dlgprefmidi.cpp dlgprefplaylist.cpp dlgprefcontrols.cpp enginebuffer.cpp enginebufferscale.cpp enginebufferscalelinear.cpp engineclipping.cpp enginefilterblock.cpp enginefilteriir.cpp engineobject.cpp enginepregain.cpp enginevolume.cpp main.cpp midiobject.cpp midiobjectnull.cpp mixxx.cpp mixxxview.cpp player.cpp playerproxy.cpp soundsource.cpp soundsourcemp3.cpp soundsourceoggvorbis.cpp monitor.cpp enginechannel.cpp enginemaster.cpp wwidget.cpp wpixmapstore.cpp wnumber.cpp wnumberpos.cpp wnumberrate.cpp wnumberbpm.cpp wknob.cpp wdisplay.cpp wvumeter.cpp wpushbutton.cpp wslidercomposed.cpp wslider.cpp wtracktable.cpp wtracktableitem.cpp enginedelay.cpp engineflanger.cpp enginespectralfwd.cpp mathstuff.cpp readerextract.cpp readerextractwave.cpp readerextracthfc.cpp readerextractbeat.cpp readerevent.cpp rtthread.cpp windowkaiser.cpp probabilityvector.cpp reader.cpp trackinfoobject.cpp enginevumeter.cpp peaklist.cpp rotary.cpp
+HEADERS += mixxxmenuplaylists.h trackplaylistlist.h mixxxkeyboard.h configobject.h fakemonitor.h controlobjectthread.h controlobjectthreadwidget.h controlobjectthreadmain.h controlevent.h controllogpotmeter.h controlobject.h controlnull.h controlpotmeter.h controlpushbutton.h controlttrotary.h controlbeat.h defs.h dlgpreferences.h dlgprefsound.h dlgprefmidi.h dlgprefplaylist.h dlgprefcontrols.h enginebuffer.h enginebufferscale.h enginebufferscalelinear.h engineclipping.h enginefilterblock.h enginefilteriir.h engineobject.h enginepregain.h enginevolume.h midiobject.h midiobjectnull.h mixxx.h mixxxview.h player.h playerproxy.h soundsource.h soundsourcemp3.h soundsourceoggvorbis.h monitor.h enginechannel.h enginemaster.h wwidget.h wpixmapstore.h wnumber.h wnumberpos.h wnumberrate.h wnumberbpm.h wknob.h wdisplay.h wvumeter.h wpushbutton.h wslidercomposed.h wslider.h wtracktable.h wtracktableitem.h enginedelay.h engineflanger.h enginespectralfwd.h mathstuff.h readerextract.h readerextractwave.h readerextracthfc.h readerextractbeat.h readerevent.h rtthread.h windowkaiser.h probabilityvector.h reader.h trackinfoobject.h enginevumeter.h peaklist.h rotary.h
+
+# New track code:
+SOURCES += track.cpp trackcollection.cpp trackplaylist.cpp xmlparse.cpp wtreeview.cpp wtreeitem.cpp wtreeitemfile.cpp wtreeitemdir.cpp wtreeitemplaylist.cpp wtreeitemplaylistroot.cpp
+HEADERS += track.h trackcollection.h trackplaylist.h xmlparse.h wtreeview.h wtreeitem.h wtreeitemfile.h wtreeitemdir.h wtreeitemplaylist.h wtreeitemplaylistroot.h
+
+# Track importer
+SOURCES += trackimporter.cpp parser.cpp parserpls.cpp parserm3u.cpp
+HEADERS += trackimporter.h parser.h parserpls.h parserm3u.h
+
+# Socket
+SOURCES += mixxxsocketserver.cpp mixxxsocketclient.cpp #mixxxsocketcli.cpp
+HEADERS += mixxxsocketserver.h mixxxsocketclient.h #mixxxsocket.cli.h
+
+IMAGES += icon.png
+DEFINES += SETTINGS_FILE=$$SETTINGS_FILE TRACK_FILE=$$TRACK_FILE
+unix:TEMPLATE = app
+win32:TEMPLATE = vcapp
+CONFIG += qt thread warn_off release
+DEFINES += QT_NO_CHECK
+#CONFIG += qt thread warn_on debug
+DBFILE = mixxx.db
+LANGUAGE = C++

Added: mixxx/branches/upstream/current/src/mixxxview.cpp
===================================================================
--- mixxx/branches/upstream/current/src/mixxxview.cpp	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/mixxxview.cpp	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,417 @@
+/***************************************************************************
+                          mixxxview.cpp  -  description
+                             -------------------
+    begin                : Mon Feb 18 09:48:17 CET 2002
+    copyright            : (C) 2002 by Tue and Ken .Haste Andersen
+    email                :
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "mixxxview.h"
+
+#include <qtable.h>
+#include <qdir.h>
+#include <qpixmap.h>
+#include <qtooltip.h>
+#include <qevent.h>
+#include <qsplitter.h>
+#include <qmenubar.h>
+#include <qmainwindow.h>
+
+#include "wtracktable.h"
+#include "wtreeview.h"
+#include "wwidget.h"
+#include "wknob.h"
+#include "wpushbutton.h"
+#include "wslider.h"
+#include "wslidercomposed.h"
+#include "wdisplay.h"
+#include "wvumeter.h"
+#include "wnumber.h"
+#include "wnumberpos.h"
+#include "wnumberbpm.h"
+#include "wnumberrate.h"
+#include "wvisualwaveform.h"
+#include "wvisualsimple.h"
+#include "mixxxkeyboard.h"
+#include "controlobject.h"
+#include "controlobjectthreadwidget.h"
+
+MixxxView::MixxxView(QWidget *parent, ConfigObject<ConfigValueKbd> *kbdconfig, bool bVisualsWaveform, QString qSkinPath, ConfigObject<ConfigValue> *pConfig) : QWidget(parent, "Mixxx")
+{
+    // Path to image files
+    WWidget::setPixmapPath(qSkinPath.append("/"));
+
+    m_qWidgetList.setAutoDelete(true);
+
+    m_pKeyboard = new MixxxKeyboard(kbdconfig);
+    installEventFilter(m_pKeyboard);
+
+    //qDebug("skin %s",qSkinPath.latin1());
+
+    // Read XML file
+    QDomDocument skin("skin");
+    QFile file(WWidget::getPath("skin.xml"));
+    if (!file.open(IO_ReadOnly))
+    {
+        qFatal("Could not open skin definition file: %s",file.name().latin1());
+    }
+    if (!skin.setContent(&file))
+    {
+        qFatal("Error parsing skin definition file: %s",file.name().latin1());
+    }
+    file.close();
+    QDomElement docElem = skin.documentElement();
+
+#ifdef __WIN__
+    // QPixmap fix needed on Windows 9x
+    QPixmap::setDefaultOptimization(QPixmap::MemoryOptim);
+#endif
+
+    // Default values for visuals
+    m_pTrackTable = 0;
+    m_pTreeView = 0;
+    m_pTextCh1 = 0;
+    m_pTextCh2 = 0;
+    m_pVisualCh1 = 0;
+    m_pVisualCh2 = 0;
+    m_pNumberPosCh1 = 0;
+    m_pNumberPosCh2 = 0;
+    m_pSliderRateCh1 = 0;
+    m_pSliderRateCh2 = 0;
+    m_bZoom = false;
+    m_pSplitter = 0;
+    m_bVisualWaveform = false;
+
+
+    // Load all widgets defined in the XML file
+    QDomNode node = docElem.firstChild();
+    while (!node.isNull())
+    {
+        if (node.isElement())
+        {
+            if (node.nodeName()=="PushButton")
+            {
+                WPushButton *p = new WPushButton(this);
+                p->setup(node);
+                p->installEventFilter(m_pKeyboard);
+                m_qWidgetList.append(p);
+            }
+            else if (node.nodeName()=="Knob")
+            {
+                WKnob *p = new WKnob(this);
+                p->setup(node);
+                p->installEventFilter(m_pKeyboard);
+                m_qWidgetList.append(p);
+            }
+            else if (node.nodeName()=="Number")
+            {
+                WNumber *p = new WNumber(this);
+                p->setup(node);
+                p->installEventFilter(m_pKeyboard);
+                m_qWidgetList.append(p);
+            }
+            else if (node.nodeName()=="NumberBpm")
+            {
+                if (WWidget::selectNodeInt(node, "Channel")==1)
+                {
+                    WNumberBpm *p = new WNumberBpm("[Channel1]", this);
+                    p->setup(node);
+                    p->installEventFilter(m_pKeyboard);
+                    m_qWidgetList.append(p);
+                }
+                else if (WWidget::selectNodeInt(node, "Channel")==2)
+                {
+                    WNumberBpm *p = new WNumberBpm("[Channel2]", this);
+                    p->setup(node);
+                    p->installEventFilter(m_pKeyboard);
+                    m_qWidgetList.append(p);
+                }
+            }
+            else if (node.nodeName()=="NumberPos")
+            {
+                if (WWidget::selectNodeInt(node, "Channel")==1 && m_pNumberPosCh1==0)
+                {
+                    m_pNumberPosCh1 = new WNumberPos("[Channel1]", this);
+                    m_pNumberPosCh1->setup(node);
+                    m_pNumberPosCh1->installEventFilter(m_pKeyboard);
+                    m_qWidgetList.append(m_pNumberPosCh1);
+                }
+                else if (WWidget::selectNodeInt(node, "Channel")==2 && m_pNumberPosCh2==0)
+                {
+                    m_pNumberPosCh2 = new WNumberPos("[Channel2]", this);
+                    m_pNumberPosCh2->setup(node);
+                    m_pNumberPosCh2->installEventFilter(m_pKeyboard);
+                    m_qWidgetList.append(m_pNumberPosCh2);
+                }
+            }
+            else if (node.nodeName()=="NumberRate")
+            {
+                if (WWidget::selectNodeInt(node, "Channel")==1)
+                {
+                    WNumberRate *p = new WNumberRate("[Channel1]", this);
+                    p->setup(node);
+                    p->installEventFilter(m_pKeyboard);
+                    m_qWidgetList.append(p);
+                }
+                else if (WWidget::selectNodeInt(node, "Channel")==2)
+                {
+                    WNumberRate *p = new WNumberRate("[Channel2]", this);
+                    p->setup(node);
+                    p->installEventFilter(m_pKeyboard);
+                    m_qWidgetList.append(p);
+                }
+            }
+            else if (node.nodeName()=="Display")
+            {
+                WDisplay *p = new WDisplay(this);
+                p->setup(node);
+                p->installEventFilter(m_pKeyboard);
+                m_qWidgetList.append(p);
+            }
+            else if (node.nodeName()=="Background")
+            {
+                QString filename = WWidget::selectNodeQString(node, "Path");
+                QPixmap background(WWidget::getPath(filename));
+                this->setPaletteBackgroundPixmap(background);
+                this->setFixedSize(background.width(),background.height()+((QMainWindow *)parent)->menuBar()->height());
+                parent->setFixedSize(background.width(),background.height()+((QMainWindow *)parent)->menuBar()->height());
+                this->move(0,0);
+            }
+            else if (node.nodeName()=="SliderComposed")
+            {
+                WSliderComposed *p = new WSliderComposed(this);
+                p->setup(node);
+                p->installEventFilter(m_pKeyboard);
+                m_qWidgetList.append(p);
+
+                // If rate slider...
+                if (compareConfigKeys(node, "[Channel1],rate"))
+                    m_pSliderRateCh1 = p;
+                else if (compareConfigKeys(node, "[Channel2],rate"))
+                    m_pSliderRateCh2 = p;
+            }
+            else if (node.nodeName()=="VuMeter")
+            {
+                WVuMeter *p = new WVuMeter(this);
+                m_qWidgetList.append(p);
+                p->setup(node);
+                p->installEventFilter(m_pKeyboard);
+            }
+            else if (node.nodeName()=="Visual")
+            {
+                if (WWidget::selectNodeInt(node, "Channel")==1 && m_pVisualCh1==0)
+                {
+                    if (bVisualsWaveform)
+                    {
+                        m_pVisualCh1 = new WVisualWaveform(this, 0, (QGLWidget *)m_pVisualCh2);
+                        if (((WVisualWaveform *)m_pVisualCh1)->isValid())
+                        {
+                            ((WVisualWaveform *)m_pVisualCh1)->setup(node);
+                            m_pVisualCh1->installEventFilter(m_pKeyboard);
+                            m_qWidgetList.append(m_pVisualCh1);
+                            m_bVisualWaveform = true;
+                        }
+                        else
+                        {
+                            m_bVisualWaveform = false;
+                            delete m_pVisualCh1;
+                        }
+                    }
+                    if (!m_bVisualWaveform)
+                    {
+                        m_pVisualCh1 = new WVisualSimple(this, 0);
+                        ((WVisualSimple *)m_pVisualCh1)->setup(node);
+                        m_pVisualCh1->installEventFilter(m_pKeyboard);
+                        m_qWidgetList.append(m_pVisualCh1);
+                    }
+                    ControlObjectThreadWidget *p = new ControlObjectThreadWidget(ControlObject::getControl(ConfigKey("[Channel1]", "wheel")));
+                    p->setWidget((QWidget *)m_pVisualCh1, true, Qt::LeftButton);
+                    //ControlObject::setWidget((QWidget *)m_pVisualCh1, ConfigKey("[Channel1]", "wheel"), true, Qt::LeftButton);
+                }
+                else if (WWidget::selectNodeInt(node, "Channel")==2 && m_pVisualCh2==0)
+                {
+                    if (bVisualsWaveform)
+                    {
+                        m_pVisualCh2 = new WVisualWaveform(this, "", (QGLWidget *)m_pVisualCh1);
+                        if (((WVisualWaveform *)m_pVisualCh2)->isValid())
+                        {
+                            ((WVisualWaveform *)m_pVisualCh2)->setup(node);
+                            m_pVisualCh2->installEventFilter(m_pKeyboard);
+                            m_bVisualWaveform = true;
+                            m_qWidgetList.append(m_pVisualCh2);
+                        }
+                        else
+                        {
+                            m_bVisualWaveform = false;
+                            delete m_pVisualCh2;
+                        }
+                    }
+                    if (!m_bVisualWaveform)
+                    {
+                        m_pVisualCh2 = new WVisualSimple(this, 0);
+                        ((WVisualSimple *)m_pVisualCh2)->setup(node);
+                        m_pVisualCh2->installEventFilter(m_pKeyboard);
+                        m_qWidgetList.append(m_pVisualCh2);
+                    }
+                    ControlObjectThreadWidget *p = new ControlObjectThreadWidget(ControlObject::getControl(ConfigKey("[Channel2]", "wheel")));
+                    p->setWidget((QWidget *)m_pVisualCh2, true, Qt::LeftButton);
+                    //ControlObject::setWidget((QWidget *)m_pVisualCh2, ConfigKey("[Channel2]", "wheel"), true, Qt::LeftButton);
+                }
+
+                if (!WWidget::selectNode(node, "Zoom").isNull() && WWidget::selectNodeQString(node, "Zoom")=="true")
+                    m_bZoom = true;
+            }
+            else if (node.nodeName()=="Text")
+            {
+                QLabel *p = new QLabel(this);
+                p->installEventFilter(m_pKeyboard);
+
+                m_qWidgetList.append(p);
+
+                // Set position
+                QString pos = WWidget::selectNodeQString(node, "Pos");
+                int x = pos.left(pos.find(",")).toInt();
+                int y = pos.mid(pos.find(",")+1).toInt();
+                p->move(x,y);
+
+                // Size
+                QString size = WWidget::selectNodeQString(node, "Size");
+                x = size.left(size.find(",")).toInt();
+                y = size.mid(size.find(",")+1).toInt();
+                p->setFixedSize(x,y);
+
+                // Background color
+                if (!WWidget::selectNode(node, "BgColor").isNull())
+                {
+                    QColor c;
+                    c.setNamedColor(WWidget::selectNodeQString(node, "BgColor"));
+                    p->setPaletteBackgroundColor(c);
+                }
+
+                // Foreground color
+                if (!WWidget::selectNode(node, "FgColor").isNull())
+                {
+                    QColor c;
+                    c.setNamedColor(WWidget::selectNodeQString(node, "FgColor"));
+                    p->setPaletteForegroundColor(c);
+                }
+
+                // Alignment
+                if (!WWidget::selectNode(node, "Align").isNull() && WWidget::selectNodeQString(node, "Align")=="right")
+                    p->setAlignment(Qt::AlignRight);
+
+                // Associate pointers
+                if (WWidget::selectNodeInt(node, "Channel")==1)
+                    m_pTextCh1 = p;
+                else if (WWidget::selectNodeInt(node, "Channel")==2)
+                    m_pTextCh2 = p;
+
+            }
+            else if (node.nodeName()=="Splitter")
+            {
+                m_pSplitter = new QSplitter(this);
+                m_pSplitter->installEventFilter(m_pKeyboard);
+
+                // Set position
+                QString pos = WWidget::selectNodeQString(node, "Pos");
+                int x = pos.left(pos.find(",")).toInt();
+                int y = pos.mid(pos.find(",")+1).toInt();
+                m_pSplitter->move(x,y);
+
+                // Size
+                QString size = WWidget::selectNodeQString(node, "Size");
+                x = size.left(size.find(",")).toInt();
+                y = size.mid(size.find(",")+1).toInt();
+                m_pSplitter->setFixedSize(x,y);
+
+                // This is QT 3.2 only
+        //m_pSplitter->setHandleWidth(2);
+
+                m_qWidgetList.append(m_pSplitter);
+            }
+            else if (node.nodeName()=="TrackTable")
+            {
+                if (m_pSplitter)
+                {
+                    m_pTrackTable = new WTrackTable(m_pSplitter);
+                    m_pSplitter->setResizeMode(m_pTrackTable, QSplitter::Stretch);
+                }
+                else
+                {
+                    m_pTrackTable = new WTrackTable(this);
+                    m_qWidgetList.append(m_pTrackTable);
+                }
+                m_pTrackTable->setup(node);
+                m_pTrackTable->installEventFilter(m_pKeyboard);
+            }
+            else if (node.nodeName()=="TreeView")
+            {
+                if (m_pSplitter)
+                {
+                    m_pTreeView = new WTreeView(pConfig->getValueString(ConfigKey("[Playlist]","Directory")), m_pSplitter, tr("TreeView"));
+                    m_pSplitter->setResizeMode(m_pTreeView, QSplitter::Stretch);
+                }
+                else
+                {
+                    m_pTreeView = new WTreeView(pConfig->getValueString(ConfigKey("[Playlist]","Directory")), this, tr("TreeView"));
+                    m_qWidgetList.append(m_pTreeView);
+                }
+                m_pTreeView->setup(node);
+                m_pTreeView->installEventFilter(m_pKeyboard);
+            }
+
+        }
+        node = node.nextSibling();
+    }
+
+#ifdef __WIN__
+    // QPixmap fix needed on Windows 9x
+    QPixmap::setDefaultOptimization(QPixmap::NormalOptim);
+#endif
+
+}
+
+MixxxView::~MixxxView()
+{
+    m_qWidgetList.clear();
+}
+
+void MixxxView::checkDirectRendering()
+{
+    // Check if DirectRendering is enabled and display warning
+    if ((m_pVisualCh1 && !((WVisualWaveform *)m_pVisualCh1)->directRendering()) ||
+	(m_pVisualCh2 && !((WVisualWaveform *)m_pVisualCh2)->directRendering()))
+        QMessageBox::warning(0, "OpenGL Direct Rendering",
+                                "Direct redering is not enabled on your machine.\n\nThis means that the waveform displays will be very\nslow and take a lot of CPU time. Either update your\nconfiguration to enable direct rendering, or disable\nthe waveform displays in the control panel by\nselecting \"Simple\" under waveform displays.\nNOTE: In case you run on NVidia hardware, direct rendering may not be present, but you will not experience a degradation in performance.");
+}
+
+bool MixxxView::activeWaveform()
+{
+    return m_bVisualWaveform;
+}
+
+bool MixxxView::compareConfigKeys(QDomNode node, QString key)
+{
+    QDomNode n = node;
+
+    // Loop over each <Connection>, check if it's ConfigKey matches key
+    while (!n.isNull())
+    {
+        n = WWidget::selectNode(n, "Connection");
+        if (!n.isNull())
+        {
+            if  (WWidget::selectNodeQString(n, "ConfigKey").contains(key))
+                return true;
+        }
+    }
+    return false;
+}

Added: mixxx/branches/upstream/current/src/soundsourcemp3.cpp
===================================================================
--- mixxx/branches/upstream/current/src/soundsourcemp3.cpp	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/soundsourcemp3.cpp	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,567 @@
+/***************************************************************************
+                          soundsourcemp3.cpp  -  description
+                             -------------------
+    copyright            : (C) 2002 by Tue and Ken Haste Andersen
+    email                :
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "soundsourcemp3.h"
+#include "trackinfoobject.h"
+extern "C" {
+#include <dxhead.h>
+}
+
+SoundSourceMp3::SoundSourceMp3(QString qFilename) : SoundSource(qFilename)
+{
+    QFile file( qFilename.latin1() );
+    if (!file.open(IO_ReadOnly))
+        qFatal("MAD: Open of %s failed.", qFilename.latin1());
+
+    // Read the whole file into inputbuf:
+    inputbuf_len = file.size();
+    inputbuf = new char[inputbuf_len];
+    unsigned int tmp = file.readBlock(inputbuf, inputbuf_len);
+    if (tmp != inputbuf_len)
+        qFatal("MAD: ERR reading mp3-file: %s\nRead only %d bytes, but wanted %d bytes.",qFilename.latin1() ,tmp,inputbuf_len);
+
+    // Transfer it to the mad stream-buffer:
+    mad_stream_init(&Stream);
+    mad_stream_options(&Stream, MAD_OPTION_IGNORECRC);
+    mad_stream_buffer(&Stream, (unsigned char *) inputbuf, inputbuf_len);
+
+    /*
+      Decode all the headers, and fill in stats:
+    */
+    mad_header Header;
+    filelength = mad_timer_zero;
+    bitrate = 0;
+    currentframe = 0;
+    pos = mad_timer_zero;
+
+    while ((Stream.bufend - Stream.this_frame) > 0)
+    {
+        if (mad_header_decode (&Header, &Stream) == -1)
+        {
+            if (!MAD_RECOVERABLE (Stream.error))
+                break;
+           /* if (Stream.ERR == MAD_ERR_LOSTSYNC)
+            {
+                // ignore LOSTSYNC due to ID3 tags
+                int tagsize = id3_tag_query (Stream.this_frame,
+                                Stream.bufend - Stream.this_frame);
+                if (tagsize > 0)
+                {
+                    mad_stream_skip (&Stream, tagsize);
+                    continue;
+                }
+            }*/
+
+            //qDebug("MAD: ERR decoding header %d: %s (len=%d)", currentframe, mad_stream_ERRstr(&Stream), len);
+            continue;
+        }
+
+        // Add frame to list of frames
+        MadSeekFrameType *p = new MadSeekFrameType;
+        p->m_pStreamPos = (unsigned char*)Stream.this_frame;
+        p->pos = length();
+        m_qSeekList.append(p);
+
+        currentframe++;
+        mad_timer_add (&filelength, Header.duration);
+        bitrate += Header.bitrate;
+        SRATE = Header.samplerate;
+        m_iChannels = MAD_NCHANNELS(&Header);
+
+    }
+    //qDebug("channels %i",m_iChannels);
+
+    // Find average frame size
+    m_iAvgFrameSize = length()/currentframe;
+
+    mad_header_finish (&Header);
+    if (currentframe==0)
+        bitrate = 0;
+    else
+        bitrate = bitrate/currentframe;
+    framecount = currentframe;
+    currentframe = 0;
+
+
+    /*
+    qDebug("length  = %ld sec." , filelength.seconds);
+    qDebug("frames  = %d" , framecount);
+    qDebug("bitrate = %d" , bitrate/1000);
+    qDebug("Size    = %d", length());
+    */
+
+    Frame = new mad_frame;
+
+    m_qSeekList.setAutoDelete(true);
+
+    // Re-init buffer:
+    seek(0);
+}
+
+SoundSourceMp3::~SoundSourceMp3()
+{
+    mad_stream_finish(&Stream);
+    mad_frame_finish(Frame);
+    mad_synth_finish(&Synth);
+    delete [] inputbuf;
+
+    m_qSeekList.clear();
+}
+
+long SoundSourceMp3::seek(long filepos)
+{
+    //qDebug("SEEK %i",filepos);
+
+    MadSeekFrameType *cur;
+
+    if (filepos==0)
+    {
+        // Seek to beginning of file
+
+        // Re-init buffer:
+        mad_stream_finish(&Stream);
+        mad_stream_init(&Stream);
+        mad_stream_options(&Stream, MAD_OPTION_IGNORECRC);
+        mad_stream_buffer(&Stream, (unsigned char *) inputbuf, inputbuf_len);
+        mad_frame_init(Frame);
+        mad_synth_init(&Synth);
+        rest=-1;
+        cur = m_qSeekList.at(0);
+    }
+    else
+    {
+        //qDebug("seek precise");
+        // Perform precise seek accomplished by using a frame in the seek list
+
+        // Find the frame to seek to in the list
+        /*
+        MadSeekFrameType *cur = m_qSeekList.last();
+        int k=0;
+        while (cur!=0 && cur->pos>filepos)
+        {
+            cur = m_qSeekList.prev();
+            ++k;
+        }
+        */
+
+        int framePos = findFrame(filepos);
+
+        //qDebug("list length %i, list pos %i",m_qSeekList.count(), k);
+
+        if (framePos==0 || framePos>filepos || m_qSeekList.at()<5)
+        {
+            //qDebug("Problem finding good seek frame (wanted %i, got %i), starting from 0",filepos,framePos);
+
+            // Re-init buffer:
+            mad_stream_finish(&Stream);
+            mad_stream_init(&Stream);
+            mad_stream_options(&Stream, MAD_OPTION_IGNORECRC);
+            mad_stream_buffer(&Stream, (unsigned char *) inputbuf, inputbuf_len);
+            mad_frame_init(Frame);
+            mad_synth_init(&Synth);
+            rest = -1;
+            cur = m_qSeekList.first();
+        }
+        else
+        {
+//            qDebug("frame pos %i",cur->pos);
+
+            // Start four frame before wanted frame to get in sync...
+            m_qSeekList.prev();
+            m_qSeekList.prev();
+            m_qSeekList.prev();
+            cur = m_qSeekList.prev();
+
+            // Start from the new frame
+            mad_stream_finish(&Stream);
+            mad_stream_init(&Stream);
+            mad_stream_options(&Stream, MAD_OPTION_IGNORECRC);
+        //qDebug("mp3 restore %p",cur->m_pStreamPos);
+            mad_stream_buffer(&Stream, (const unsigned char*)cur->m_pStreamPos, inputbuf_len-(long int)(cur->m_pStreamPos-(unsigned char*)inputbuf));
+            mad_synth_mute(&Synth);
+            mad_frame_mute(Frame);
+
+            // Decode the three frames before
+            mad_frame_decode(Frame,&Stream);
+            mad_frame_decode(Frame,&Stream);
+            mad_frame_decode(Frame,&Stream);
+            if(mad_frame_decode(Frame,&Stream)) qDebug("MP3 decode warning");
+            mad_synth_frame(&Synth, Frame);
+
+            // Set current position
+            rest = -1;
+            m_qSeekList.next();
+            m_qSeekList.next();
+            m_qSeekList.next();
+            cur = m_qSeekList.next();
+        }
+
+        // Synthesize the the samples from the frame which should be discard to reach the requested position
+        SAMPLE *temp = new SAMPLE[READCHUNKSIZE];
+        int r = read(filepos-cur->pos, temp);
+        //qDebug("try read %i, got %i...frame pos %i, filepos %i",filepos-cur->pos,r,cur->pos,filepos);
+        //qDebug("ok");
+        delete [] temp;
+    }
+/*
+    else
+    {
+        qDebug("seek unprecise");
+        // Perform seek which is can not be done precise because no frames is in the seek list
+
+        int newpos = (int)(inputbuf_len * ((float)filepos/(float)length()));
+//        qDebug("Seek to %d %d %d", filepos, inputbuf_len, newpos);
+
+        // Go to an approximate position:
+        mad_stream_buffer(&Stream, (unsigned char *) (inputbuf+newpos), inputbuf_len-newpos);
+        mad_synth_mute(&Synth);
+        mad_frame_mute(Frame);
+
+        // Decode a few (possible wrong) buffers:
+        int no = 0;
+        int succesfull = 0;
+        while ((no<10) && (succesfull<2))
+        {
+            if (!mad_frame_decode(Frame, &Stream))
+            succesfull ++;
+            no ++;
+        }
+
+        // Discard the first synth:
+        mad_synth_frame(&Synth, Frame);
+
+        // Remaining samples in buffer are useless
+        rest = -1;
+
+        // Reset seek frame list
+        m_qSeekList.clear();
+        MadSeekFrameType *p = new MadSeekFrameType;
+        p->m_pStreamPos = (unsigned char*)Stream.this_frame;
+        p->pos = filepos;
+        m_qSeekList.append(p);
+        m_iSeekListMinPos = filepos;
+        m_iSeekListMaxPos = filepos;
+        m_iCurFramePos = filepos;
+    }
+*/
+
+    // Unfortunately we don't know the exact fileposition. The returned position is thus an
+    // approximation only:
+    return filepos;
+
+}
+
+inline long unsigned SoundSourceMp3::length()
+{
+    return (long unsigned) 2*mad_timer_count(filelength, MAD_UNITS_44100_HZ);
+}
+
+/*
+  read <size> samples into <destination>, and return the number of
+  samples actually read.
+*/
+unsigned SoundSourceMp3::read(unsigned long samples_wanted, const SAMPLE* _destination)
+{
+//    qDebug("frame list %i",m_qSeekList.count());
+
+    SAMPLE *destination = (SAMPLE *)_destination;
+    unsigned Total_samples_decoded = 0;
+
+    // If samples are left from previous read, then copy them to start of destination
+    if (rest > 0)
+    {
+        for (int i=rest; i<Synth.pcm.length; i++)
+        {
+            // Left channel
+            *(destination++) = madScale(Synth.pcm.samples[0][i]);
+
+            /* Right channel. If the decoded stream is monophonic then
+             * the right output channel is the same as the left one. */
+            if (m_iChannels>1)
+                *(destination++) = madScale(Synth.pcm.samples[1][i]);
+            else
+                *(destination++) = madScale(Synth.pcm.samples[0][i]);
+        }
+        Total_samples_decoded += 2*(Synth.pcm.length-rest);
+    }
+
+    //qDebug("Decoding");
+    int no = 0;
+    int frames = 0;
+    while (Total_samples_decoded < samples_wanted)
+    {
+        //qDebug("no %i",Total_samples_decoded);
+        if(mad_frame_decode(Frame,&Stream))
+        {
+            if(MAD_RECOVERABLE(Stream.error))
+            {
+                //qDebug("MAD: Recoverable frame level ERR (%s)",mad_stream_errorstr(&Stream));
+                continue;
+            } else if(Stream.error==MAD_ERROR_BUFLEN) {
+                //qDebug("MAD: buflen ERR");
+                break;
+            } else {
+                //qDebug("MAD: Unrecoverable frame level ERR (%s).",mad_stream_errorstr(&Stream));
+                break;
+            }
+        }
+
+        ++frames;
+
+        /* Once decoded the frame is synthesized to PCM samples. No ERRs
+         * are reported by mad_synth_frame();
+         */
+        mad_synth_frame(&Synth,Frame);
+
+        // Number of channels in frame
+        //ch = MAD_NCHANNELS(&Frame->header);
+
+        /* Synthesized samples must be converted from mad's fixed
+         * point number to the consumer format (16 bit). Integer samples
+         * are temporarily stored in a buffer that is flushed when
+         * full.
+         */
+
+
+        //qDebug("synthlen %i, remain %i",Synth.pcm.length,(samples_wanted-Total_samples_decoded));
+        no = min(Synth.pcm.length,(samples_wanted-Total_samples_decoded)/2);
+        for (int i=0; i<no; i++)
+        {
+            // Left channel
+            *(destination++) = madScale(Synth.pcm.samples[0][i]);
+
+            /* Right channel. If the decoded stream is monophonic then
+             * the right output channel is the same as the left one. */
+            if (m_iChannels==2)
+                *(destination++) = madScale(Synth.pcm.samples[1][i]);
+            else
+                *(destination++) = madScale(Synth.pcm.samples[0][i]);
+        }
+        Total_samples_decoded += 2*no;
+
+        //qDebug("decoded: %i, wanted: %i",Total_samples_decoded,samples_wanted);
+    }
+
+    // If samples are still left in buffer, set rest to the index of the unused samples
+    if (Synth.pcm.length > no)
+        rest = no;
+    else
+        rest = -1;
+
+    //qDebug("decoded %i samples in %i frames, rest: %i, chan %i", Total_samples_decoded, frames, rest, m_iChannels);
+    return Total_samples_decoded;
+}
+
+int SoundSourceMp3::ParseHeader(TrackInfoObject *Track)
+{
+    QString location = Track->getLocation();
+
+    Track->setType("mp3");
+
+    id3_file *fh = id3_file_open(location.latin1(), ID3_FILE_MODE_READONLY);
+    if (fh!=0)
+    {
+        id3_tag *tag = id3_file_tag(fh);
+        if (tag!=0)
+        {
+            QString s;
+            getField(tag,"TIT2",&s);
+            if (s.length()>2)
+                Track->setTitle(s);
+            s="";
+            getField(tag,"TPE1",&s);
+            if (s.length()>2)
+                Track->setArtist(s);
+
+            /*
+            // On some tracks this segfaults. TLEN is very seldom used anyway...
+            QString dur;
+            getField(tag,"TLEN",&dur);
+            if (dur.length()>0)
+                Track->m_iDuration = dur.toInt();
+            */
+        }
+        id3_file_close(fh);
+    }
+    else
+        return ERR;
+
+    // Get file length. This has to be done by one of these options:
+    // 1) looking for the tag named TLEN (above),
+    // 2) See if the first frame contains a Xing header to get frame count
+    // 3) If file does not contain Xing header, find out if it is a variable frame size file
+    //    by looking at the size of the first 10 frames. If constant size, estimate frame number
+    //    from one frame size and file length in bytes
+    // 4) Count all the frames (slooow)
+
+    // Open file, initialize MAD and read beginnning of file
+
+    // Number of bytes to read from file to determine duration
+    const unsigned int READLENGTH = 5000;
+    mad_timer_t dur = mad_timer_zero;
+    QFile file(location.latin1());
+    if (!file.open(IO_ReadOnly)) {
+        qDebug("MAD: Open of %s failed.", location.latin1());
+        return ERR;
+    }
+    char *inputbuf = new char[READLENGTH];
+    unsigned int tmp = file.readBlock(inputbuf, READLENGTH);
+    if (tmp != READLENGTH) {
+        qDebug("MAD: ERR reading mp3-file: %s\nRead only %d bytes, but wanted %d bytes.",location.latin1() ,tmp,READLENGTH);
+        return ERR;
+    }
+    mad_stream Stream;
+    mad_header Header;
+    mad_stream_init(&Stream);
+    mad_stream_options(&Stream, MAD_OPTION_IGNORECRC);
+    mad_stream_buffer(&Stream, (unsigned char *) inputbuf, READLENGTH);
+
+    // Check for Xing header
+    XHEADDATA *xing = new XHEADDATA;
+    xing->toc = 0;
+    bool foundxing = false;
+    if (GetXingHeader(xing, (unsigned char *)Stream.this_frame)==1)
+    {
+        foundxing = true;
+
+        if (mad_header_decode (&Header, &Stream) != -1)
+        {
+            dur = Header.duration;
+            mad_timer_multiply(&dur,xing->frames);
+        }
+    }
+    delete xing;
+
+    if (foundxing)
+    {
+        Track->setDuration(dur.seconds);
+    }
+    else
+    {
+        // Check if file has constant bit rate by examining the rest of the buffer
+        unsigned long bitrate;
+        int i=0;
+        bool constantbitrate = true;
+        int frames = 0;
+        while ((Stream.bufend - Stream.this_frame) > 0)
+        {
+            if (mad_header_decode (&Header, &Stream) == -1)
+            {
+                if (!MAD_RECOVERABLE (Stream.error))
+                    break;
+            }
+            if (i==0)
+            {
+                bitrate = Header.bitrate;
+                dur = Header.duration;
+            }
+            else if (bitrate != Header.bitrate)
+                constantbitrate = false;
+
+            frames++;
+        }
+        if (constantbitrate && frames>1)
+        {
+            mad_timer_multiply(&dur, Track->getLength()/((Stream.this_frame-Stream.buffer)/frames));
+            Track->setDuration(dur.seconds);
+            Track->setBitrate(Header.bitrate/1000);
+        }
+//        else
+//            qDebug("MAD: Count frames to get file duration!");
+    }
+
+    mad_stream_finish(&Stream);
+    delete [] inputbuf;
+    file.close();
+    return OK;
+}
+
+void SoundSourceMp3::getField(id3_tag *tag, const char *frameid, QString *str)
+{
+    id3_frame *frame = id3_tag_findframe(tag, frameid, 0);
+    if (frame)
+    {
+        // Unicode handling
+        if (id3_field_getnstrings(&frame->fields[1])>0)
+        {
+            id3_utf16_t *framestr = id3_ucs4_utf16duplicate(id3_field_getstrings(&frame->fields[1], 0));
+            int strlen = 0; while (framestr[strlen]!=0) strlen++;
+            if (strlen>0)
+                str->setUnicodeCodes((ushort *)framestr,strlen);
+            free(framestr);
+        }
+    }
+}
+
+int SoundSourceMp3::findFrame(int pos)
+{
+    // Guess position of frame in m_qSeekList based on average frame size
+    MadSeekFrameType *temp = m_qSeekList.at(min(m_qSeekList.count()-1, (unsigned int)(pos/m_iAvgFrameSize)));
+
+/*
+    if (temp!=0)
+        qDebug("find %i, got %i",pos, temp->pos);
+    else
+        qDebug("find %i, tried idx %i, total %i",pos, min(m_qSeekList.count()-1, pos/m_iAvgFrameSize),m_qSeekList.count());
+*/
+
+    // Ensure that the list element is not at a greater position than pos
+    while (temp!=0 && temp->pos>pos)
+    {
+        temp = m_qSeekList.prev();
+//        if (temp!=0) qDebug("backing %i, got %i",pos,temp->pos);
+    }
+
+    // Ensure that the following position is also not smaller than pos
+    if (temp!=0)
+    {
+        temp = m_qSeekList.current();
+        while (temp!=0 && temp->pos<pos)
+        {
+            temp = m_qSeekList.next();
+//            if (temp!=0) qDebug("fwd'ing %i, got %i",pos,temp->pos);
+        }
+
+        if (temp==0)
+            temp = m_qSeekList.last();
+        else
+            temp = m_qSeekList.prev();
+    }
+
+    if (temp>0)
+    {
+//        qDebug("ended at %i, got %i",pos,temp->pos);
+        return temp->pos;
+    }
+    else
+    {
+//        qDebug("ended at 0");
+        return 0;
+    }
+}
+
+inline signed int SoundSourceMp3::madScale (mad_fixed_t sample)
+{
+    sample += (1L << (MAD_F_FRACBITS - 16));
+
+    if (sample >= MAD_F_ONE)
+        sample = MAD_F_ONE - 1;
+    else if (sample < -MAD_F_ONE)
+        sample = -MAD_F_ONE;
+
+    return sample >> (MAD_F_FRACBITS + 1 - 16);
+}
+

Added: mixxx/branches/upstream/current/src/wvisualwaveform.cpp
===================================================================
--- mixxx/branches/upstream/current/src/wvisualwaveform.cpp	2007-04-18 13:37:20 UTC (rev 1207)
+++ mixxx/branches/upstream/current/src/wvisualwaveform.cpp	2007-04-19 06:33:31 UTC (rev 1208)
@@ -0,0 +1,214 @@
+/***************************************************************************
+                          wvisualwaveform.cpp  -
+                             -------------------
+    begin                : Thu Oct 9 2003
+    copyright            : (C) 2002 by Tue & Ken Haste Andersen
+    email                : haste at diku.dk
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "wvisualwaveform.h"
+#include "visual/visualchannel.h"
+#include "visual/visualdisplay.h"
+#include <qdragobject.h>
+
+WVisualWaveform::WVisualWaveform(QWidget *pParent, const char *pName, const QGLWidget *pShareWidget) : QGLWidget(pParent,pName,pShareWidget)
+{
+    setAcceptDrops(true);
+    m_pVisualController = new VisualController();
+
+    installEventFilter(this);
+
+#ifdef __MACX__
+    // Hack to reduce load in GUI thread. This makes the system behave 
+    // "correctly" on MacOS X, where it would otherwise stall the system
+    // for some seconds now and then.
+    startTimer(100);
+#endif
+#ifdef __WIN__
+    startTimer(15);
+#endif
+#ifdef __LINUX__
+    startTimer(15);
+#endif
+
+    m_qlList.setAutoDelete(false);
+}
+
+WVisualWaveform::~WVisualWaveform()
+{
+    // Stop timer
+    killTimers();
+
+    // Delete associated VisualChannels
+    while (m_qlList.remove());
+
+    // Finally delete the VisualController
+    delete m_pVisualController;
+}
+
+bool WVisualWaveform::directRendering()
+{
+    return format().directRendering();
+}
+
+void WVisualWaveform::dragEnterEvent(QDragEnterEvent *event)
+{
+    event->accept(QUriDrag::canDecode(event));
+}
+
+void WVisualWaveform::dropEvent(QDropEvent *event)
+{
+    QStringList lst;
+    if (!QUriDrag::canDecode(event))
+    {
+        event->ignore();
+        return;
+    }
+
+    event->accept();
+    QUriDrag::decodeLocalFiles(event, lst);
+    QString name = (*lst.begin());
+
+    emit(trackDropped(name));
+}
+
+void WVisualWaveform::setup(QDomNode node)
+{
+    // Colors
+    colorBack.setNamedColor(WWidget::selectNodeQString(node, "BgColor"));
+    m_pVisualController->setBackgroundColor(colorBack);
+    colorSignal.setNamedColor(WWidget::selectNodeQString(node, "SignalColor"));
+    colorHfc.setNamedColor(WWidget::selectNodeQString(node, "HfcColor"));
+    colorMarker.setNamedColor(WWidget::selectNodeQString(node, "MarkerColor"));
+    colorBeat.setNamedColor(WWidget::selectNodeQString(node, "BeatColor"));
+    colorFisheye.setNamedColor(WWidget::selectNodeQString(node, "FisheyeColor"));
+
+    // Set position
+    QString pos = WWidget::selectNodeQString(node, "Pos");
+    int x = pos.left(pos.find(",")).toInt();
+    int y = pos.mid(pos.find(",")+1).toInt();
+    move(x,y);
+
+    // Size
+    QString size = WWidget::selectNodeQString(node, "Size");
+    x = size.left(size.find(",")).toInt();
+    y = size.mid(size.find(",")+1).toInt();
+    setFixedSize(x,y);
+
+
+}
+
+bool WVisualWaveform::eventFilter(QObject *o, QEvent *e)
+{
+    // Handle mouse press events
+    if (e->type() == QEvent::MouseButtonPress)
+    {
+        QMouseEvent *m = (QMouseEvent *)e;
+
+        m_iStartPosX = -1;
+        if (m->button()==Qt::LeftButton)
+        {
+            // Store current x position of mouse pointer
+            m_iStartPosX = m->x();
+            emit(valueChangedLeftDown(64.));
+        }
+/*
+        else if (m->button()==Qt::RightButton)
+        {
+            // Toggle fish eye mode on each channel associated
+            VisualChannel *c;
+            for (c=m_qlList.first(); c; c=m_qlList.next())
+                c->toggleFishEyeMode();
+        }
+*/
+    }
+    else if (e->type() == QEvent::MouseMove)
+    {
+        // Only process mouse move if it was initiated by a left click
+        if (m_iStartPosX!=-1)
+        {
+            QMouseEvent *m = (QMouseEvent *)e;
+            int v = 64+m->x()-m_iStartPosX;
+            if (v<0)
+                v = 0;
+            else if (v>127)
+                v= 127;
+            emit(valueChangedLeftDown((double)v));
+        }
+    }
+    else if (e->type() == QEvent::MouseButtonRelease)
+    {
+        emit(valueChangedLeftDown(64.));
+    }
+    else
+    {
+        // standard event processing
+        return QObject::eventFilter(o,e);
+    }
+    return true;
+}
+
+VisualChannel *WVisualWaveform::add(const char *group)
+{
+    VisualChannel *c = new VisualChannel(m_pVisualController, group);
+
+    // Position coding... hack
+    //if (m_qlList.isEmpty())
+    {
+/*
+        c->setPosX(-(width()/2));
+        c->setLength(800); //width());
+        c->setHeight(50); //height());
+        c->setZoomPosX(50);
+*/
+        c->setColorBack((float)colorBack.red()/255., (float)colorBack.green()/255., (float)colorBack.blue()/255.);
+        c->setColorSignal((float)colorSignal.red()/255., (float)colorSignal.green()/255., (float)colorSignal.blue()/255.);
+        c->setColorHfc((float)colorHfc.red()/255., (float)colorHfc.green()/255., (float)colorHfc.blue()/255.);
+        c->setColorMarker((float)colorMarker.red()/255., (float)colorMarker.green()/255., (float)colorMarker.blue()/255.);
+        c->setColorBeat((float)colorBeat.red()/255., (float)colorBeat.green()/255., (float)colorBeat.blue()/255.);
+        c->setColorFisheye((float)colorFisheye.red()/255., (float)colorFisheye.green()/255., (float)colorFisheye.blue()/255.);
+    }
+    /* else
+    {
+        c->setPosX(50);
+        c->setZoomPosX(50);
+    } */
+
+    m_qlList.append(c);
+    return c;
+}
+
+void WVisualWaveform::initializeGL()
+{
+    m_pVisualController->init();
+    //m_pVisualBackplane = new VisualBackplane();
+//    controller->add(m_pVisualBackplane);
+
+    m_Picking.init(m_pVisualController);
+}
+
+
+void WVisualWaveform::paintGL()
+{
+    // Display stuff
+    m_pVisualController->display();
+}
+
+void WVisualWaveform::resizeGL(int width, int height)
+{
+    m_pVisualController->resize((GLsizei)width,(GLsizei)height);
+}
+
+void WVisualWaveform::timerEvent(QTimerEvent*)
+{
+    updateGL();
+}




More information about the Demudi-commits mailing list