mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-07-23 16:08:15 +02:00
2018-10-19 Fred Gleason <fredg@paravelsystems.com>
* Removed 'build_win32.bat'. * Removed all conditional compilation based on 'WIN32'.
This commit is contained in:
parent
a127f98758
commit
75bec4d3c4
@ -17845,3 +17845,6 @@
|
||||
start retries.
|
||||
2018-10-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Fixed a typo that broke generation of the rmlsend(1) man page.
|
||||
2018-10-19 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Removed 'build_win32.bat'.
|
||||
* Removed all conditional compilation based on 'WIN32'.
|
||||
|
@ -106,7 +106,6 @@ doxygen:
|
||||
cd ripcd && doxygen doxygen.conf &
|
||||
|
||||
EXTRA_DIST = autogen.sh\
|
||||
build_win32.bat\
|
||||
CODINGSTYLE\
|
||||
get_distro.pl\
|
||||
get_target.sh\
|
||||
|
@ -1,37 +0,0 @@
|
||||
@ECHO OFF
|
||||
|
||||
REM build_win32.bat
|
||||
REM
|
||||
REM Build Rivendell for Win32.
|
||||
REM
|
||||
REM (C) Copyright 2007 Fred Gleason <fredg@paravelsystems.com>
|
||||
REM
|
||||
REM This program is free software; you can redistribute it and/or modify
|
||||
REM it under the terms of the GNU General Public License as
|
||||
REM published by the Free Software Foundation; either version 2 of
|
||||
REM the License, or (at your option) any later version.
|
||||
REM
|
||||
REM This program is distributed in the hope that it will be useful,
|
||||
REM but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
REM GNU General Public License for more details.
|
||||
REM
|
||||
REM You should have received a copy of the GNU General Public
|
||||
REM License along with this program; if not, write to the Free Software
|
||||
REM Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
REM
|
||||
REM Stupid DOS trick to get the package version
|
||||
REM
|
||||
copy helpers\win32_frag1.txt + package_version + helpers\win32_frag2.txt helpers\win32_version.bat
|
||||
call helpers\win32_version.bat
|
||||
del helpers\win32_version.bat
|
||||
|
||||
REM
|
||||
REM Build It
|
||||
REM
|
||||
qmake -o Makefile rivendell.pro
|
||||
nmake
|
||||
|
||||
|
||||
REM End of build_win32.bat
|
@ -36,9 +36,7 @@ dist_jsmin_SOURCES = jsmin.c
|
||||
EXTRA_DIST = rdpack.sh\
|
||||
rdtrans.sh\
|
||||
rdtransgui.sh\
|
||||
setenvvar.sh\
|
||||
win32_frag1.txt\
|
||||
win32_frag2.txt
|
||||
setenvvar.sh
|
||||
|
||||
CLEANFILES = *~\
|
||||
*.tar.gz\
|
||||
|
@ -1 +0,0 @@
|
||||
qmake -set VERSION "
|
@ -1 +0,0 @@
|
||||
"
|
1
lib/rd.h
1
lib/rd.h
@ -430,7 +430,6 @@
|
||||
* Default Text Editors
|
||||
*/
|
||||
#define RD_LINUX_EDITOR "xterm -e vi"
|
||||
#define RD_WIN32_EDITOR "notepad"
|
||||
|
||||
/*
|
||||
* System-wide Maintenance Interval (mS)
|
||||
|
@ -18,12 +18,10 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <syslog.h>
|
||||
#include <curl/curl.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -91,11 +89,9 @@ bool RDCart::selectCut(QString *cut,const QTime &time) const
|
||||
if(!exists()) {
|
||||
ret=(*cut=="");
|
||||
*cut="";
|
||||
#ifndef WIN32
|
||||
syslog(LOG_USER|LOG_WARNING,
|
||||
"RDCart::selectCut(): cart doesn't exist, CUT=%s",
|
||||
(const char *)cut);
|
||||
#endif // WIN32
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -147,9 +143,6 @@ bool RDCart::selectCut(QString *cut,const QTime &time) const
|
||||
break;
|
||||
}
|
||||
if(cutname.isEmpty()) { // No valid cuts, try the evergreen
|
||||
#ifndef WIN32
|
||||
// syslog(LOG_USER|LOG_WARNING,"RDCart::selectCut(): no valid cuts, trying evergreen, SQL=%s",(const char *)sql);
|
||||
#endif // WIN32
|
||||
sql=QString("select ")+
|
||||
"CUT_NAME,"+
|
||||
"PLAY_ORDER,"+
|
||||
@ -171,9 +164,6 @@ bool RDCart::selectCut(QString *cut,const QTime &time) const
|
||||
delete q;
|
||||
}
|
||||
if(cutname.isEmpty()) {
|
||||
#ifndef WIN32
|
||||
// syslog(LOG_USER|LOG_WARNING,"RDCart::selectCut(): no valid evergreen cuts, SQL=%s",(const char *)sql);
|
||||
#endif // WIN32
|
||||
}
|
||||
*cut=cutname;
|
||||
return true;
|
||||
@ -817,7 +807,6 @@ void RDCart::setUseEventLength(bool state) const
|
||||
|
||||
void RDCart::setPending(const QString &station_name)
|
||||
{
|
||||
#ifndef WIN32
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
@ -828,7 +817,6 @@ void RDCart::setPending(const QString &station_name)
|
||||
QString().sprintf("where NUMBER=%u",cart_number);
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -978,9 +966,6 @@ bool RDCart::validateLengths(int len) const
|
||||
QString RDCart::xml(bool include_cuts,bool absolute,
|
||||
RDSettings *settings,int cutnum) const
|
||||
{
|
||||
#ifdef WIN32
|
||||
return QString();
|
||||
#else
|
||||
QString sql=RDCart::xmlSql(include_cuts)+
|
||||
QString().sprintf(" where (CART.NUMBER=%u)",cart_number);
|
||||
if(cutnum>=0) {
|
||||
@ -991,7 +976,6 @@ QString RDCart::xml(bool include_cuts,bool absolute,
|
||||
delete q;
|
||||
|
||||
return xml;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -1640,7 +1624,6 @@ bool RDCart::removeCutAudio(RDStation *station,RDUser *user,unsigned cart_num,
|
||||
const QString &cutname,RDConfig *config)
|
||||
{
|
||||
bool ret=true;
|
||||
#ifndef WIN32
|
||||
CURL *curl=NULL;
|
||||
long response_code=0;
|
||||
struct curl_httppost *first=NULL;
|
||||
@ -1702,14 +1685,12 @@ bool RDCart::removeCutAudio(RDStation *station,RDUser *user,unsigned cart_num,
|
||||
curl_easy_cleanup(curl);
|
||||
curl_formfree(first);
|
||||
}
|
||||
#endif // WIN32
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
void RDCart::removePending(RDStation *station,RDUser *user,RDConfig *config)
|
||||
{
|
||||
#ifndef WIN32
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
|
||||
@ -1721,7 +1702,6 @@ void RDCart::removePending(RDStation *station,RDUser *user,RDConfig *config)
|
||||
|
||||
}
|
||||
delete q;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rdapplication.h>
|
||||
#ifndef WIN32
|
||||
#include <rdaudioimport.h>
|
||||
#include <rdcart_dialog.h>
|
||||
#include <rdcart_search_text.h>
|
||||
@ -42,7 +41,6 @@
|
||||
#include <rdprofile.h>
|
||||
#include <rdsettings.h>
|
||||
#include <rdtextvalidator.h>
|
||||
#endif // WIN32
|
||||
#include <rdwavefile.h>
|
||||
|
||||
//
|
||||
@ -69,11 +67,7 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
*cart_schedcode=tr("ALL");
|
||||
}
|
||||
cart_temp_allowed=NULL;
|
||||
#ifdef WIN32
|
||||
cart_filter_mode=RDStation::FilterSynchronous;
|
||||
#else
|
||||
cart_filter_mode=rda->station()->filterMode();
|
||||
#endif // WIN32
|
||||
|
||||
if(filter==NULL) {
|
||||
cart_filter=new QString();
|
||||
@ -245,7 +239,6 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
//
|
||||
// Audition Player
|
||||
//
|
||||
#ifndef WIN32
|
||||
if((rda->station()->cueCard()<0)||(rda->station()->cuePort()<0)) {
|
||||
cart_player=NULL;
|
||||
}
|
||||
@ -257,7 +250,6 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
cart_player->stopButton()->setDisabled(true);
|
||||
cart_player->stopButton()->setOnColor(Qt::red);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Send to Editor Button
|
||||
@ -278,9 +270,6 @@ RDCartDialog::RDCartDialog(QString *filter,QString *group,QString *schedcode,
|
||||
if(rda->station()->editorPath().isEmpty()) {
|
||||
cart_file_button->hide();
|
||||
}
|
||||
#ifdef WIN32
|
||||
cart_file_button->hide();
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// OK Button
|
||||
@ -303,11 +292,9 @@ RDCartDialog::~RDCartDialog()
|
||||
if(local_filter) {
|
||||
delete cart_filter;
|
||||
}
|
||||
#ifndef WIN32
|
||||
if(cart_player!=NULL) {
|
||||
delete cart_player;
|
||||
}
|
||||
#endif // WIN32
|
||||
delete cart_playout_map;
|
||||
delete cart_macro_map;
|
||||
}
|
||||
@ -345,22 +332,18 @@ int RDCartDialog::exec(int *cartnum,RDCart::Type type,QString *svcname,
|
||||
else {
|
||||
cart_file_button->show();
|
||||
}
|
||||
#ifndef WIN32
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->playButton()->show();
|
||||
cart_player->stopButton()->show();
|
||||
}
|
||||
#endif // WIN32
|
||||
break;
|
||||
|
||||
case RDCart::Macro:
|
||||
cart_editor_button->hide();
|
||||
#ifndef WIN32
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->playButton()->hide();
|
||||
cart_player->stopButton()->hide();
|
||||
}
|
||||
#endif // WIN32
|
||||
break;
|
||||
}
|
||||
if(*cart_cartnum==0) {
|
||||
@ -469,13 +452,11 @@ void RDCartDialog::clickedData(Q3ListViewItem *item)
|
||||
}
|
||||
cart_ok_button->setEnabled(true);
|
||||
bool audio=((RDCart::Type)i->id())==RDCart::Audio;
|
||||
#ifndef WIN32
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->playButton()->setEnabled(audio);
|
||||
cart_player->stopButton()->setEnabled(audio);
|
||||
cart_player->setCart(i->text(1).toUInt());
|
||||
}
|
||||
#endif // WIN32
|
||||
cart_editor_button->setEnabled(audio);
|
||||
}
|
||||
|
||||
@ -488,7 +469,6 @@ void RDCartDialog::doubleClickedData(Q3ListViewItem *,const QPoint &,int)
|
||||
|
||||
void RDCartDialog::editorData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
RDListViewItem *item=(RDListViewItem *)cart_cart_list->currentItem();
|
||||
if(item==NULL) {
|
||||
return;
|
||||
@ -531,13 +511,11 @@ void RDCartDialog::editorData()
|
||||
system(cmd+" &");
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void RDCartDialog::loadFileData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
QString filename;
|
||||
RDCart *cart=NULL;
|
||||
RDCut *cut=NULL;
|
||||
@ -615,7 +593,6 @@ void RDCartDialog::loadFileData()
|
||||
delete cut;
|
||||
done(0);
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -626,12 +603,10 @@ void RDCartDialog::okData()
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
SaveState();
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->stop();
|
||||
}
|
||||
#endif // WIN32
|
||||
if(!local_filter) {
|
||||
*cart_filter=cart_filter_edit->text();
|
||||
}
|
||||
@ -645,12 +620,10 @@ void RDCartDialog::okData()
|
||||
|
||||
void RDCartDialog::cancelData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
SaveState();
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->stop();
|
||||
}
|
||||
#endif // WIN32
|
||||
done(-1);
|
||||
}
|
||||
|
||||
@ -682,22 +655,18 @@ void RDCartDialog::resizeEvent(QResizeEvent *e)
|
||||
cart_filter_edit->setGeometry(100,10,size().width()-200,20);
|
||||
break;
|
||||
}
|
||||
#ifndef WIN32
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->playButton()->setGeometry(10,size().height()-60,80,50);
|
||||
cart_player->stopButton()->setGeometry(100,size().height()-60,80,50);
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
void RDCartDialog::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
#ifndef WIN32
|
||||
if(cart_player!=NULL) {
|
||||
cart_player->stop();
|
||||
}
|
||||
#endif // WIN32
|
||||
cancelData();
|
||||
}
|
||||
|
||||
|
@ -115,9 +115,7 @@ class RDCartDialog : public QDialog
|
||||
QString cart_user_name;
|
||||
QString cart_user_password;
|
||||
RDBusyDialog *cart_busy_dialog;
|
||||
#ifndef WIN32
|
||||
RDSimplePlayer *cart_player;
|
||||
#endif // WIN32
|
||||
};
|
||||
|
||||
|
||||
|
@ -19,14 +19,13 @@
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#ifndef WIN32
|
||||
#include <syslog.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <rdcmd_switch.h>
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include <rdcmd_switch.h>
|
||||
|
||||
RDCmdSwitch::RDCmdSwitch(int argc,char *argv[],const char *modname,
|
||||
const char *usage)
|
||||
{
|
||||
@ -34,12 +33,10 @@ RDCmdSwitch::RDCmdSwitch(int argc,char *argv[],const char *modname,
|
||||
|
||||
for(int i=1;i<argc;i++) {
|
||||
QString value=QString::fromUtf8(argv[i]);
|
||||
#ifndef WIN32
|
||||
if(value=="--version") {
|
||||
printf("Rivendell v%s [%s]\n",VERSION,modname);
|
||||
exit(0);
|
||||
}
|
||||
#endif // WIN32
|
||||
if(value=="--help") {
|
||||
printf("\n%s %s\n",modname,usage);
|
||||
exit(0);
|
||||
@ -66,14 +63,12 @@ RDCmdSwitch::RDCmdSwitch(int argc,char *argv[],const char *modname,
|
||||
//
|
||||
// Initialize Logging
|
||||
//
|
||||
#ifndef WIN32
|
||||
if(debug) {
|
||||
openlog(modname,LOG_PERROR,LOG_USER);
|
||||
}
|
||||
else {
|
||||
openlog(modname,0,LOG_USER);
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,15 +31,12 @@
|
||||
#include <qvariant.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qdir.h>
|
||||
#ifdef WIN32
|
||||
#define RDCONF_FILE_SEPARATOR '\\'
|
||||
#else
|
||||
#define RDCONF_FILE_SEPARATOR '/'
|
||||
#include <unistd.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/timex.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include <rddb.h>
|
||||
#include <rdconf.h>
|
||||
#include <rdescape_string.h>
|
||||
@ -57,21 +54,12 @@ int GetPrivateProfileBool(const char *sFilename,const char *cHeader,
|
||||
if(temp[0]==0) {
|
||||
return bDefault;
|
||||
}
|
||||
#ifdef WIN32
|
||||
if((!stricmp(temp,"yes"))||(!stricmp(temp,"on"))) {
|
||||
return true;
|
||||
}
|
||||
if((!stricmp(temp,"no"))||(!stricmp(temp,"off"))) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
if((!strcasecmp(temp,"yes"))||(!strcasecmp(temp,"on"))) {
|
||||
return true;
|
||||
}
|
||||
if((!strcasecmp(temp,"no"))||(!strcasecmp(temp,"off"))) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
return bDefault;
|
||||
}
|
||||
|
||||
@ -150,13 +138,6 @@ int GetIni(const char *sFileName,const char *cHeader,const char *cLabel,
|
||||
int iFileStat;
|
||||
|
||||
strcpy(sName,sFileName);
|
||||
#ifdef WIN32
|
||||
for(int i=0;i<strlen(sName);i++) {
|
||||
if(sName[i]=='/') {
|
||||
sName[i]='\\';
|
||||
}
|
||||
}
|
||||
#endif // WIN32
|
||||
cIniName=fopen(sName,"r");
|
||||
if(cIniName==NULL) {
|
||||
return 2; /* ini file doesn't exist! */
|
||||
@ -231,7 +212,6 @@ void Prepend(char *sPathname,char *sFilename)
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
int IncrementIndex(char *sPathname,int dMaxIndex)
|
||||
{
|
||||
int dLockname=-1;
|
||||
@ -296,7 +276,6 @@ int IncrementIndex(char *sPathname,int dMaxIndex)
|
||||
|
||||
return dIndex;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@ -323,7 +302,6 @@ void StripLevel(char *sString)
|
||||
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
bool GetLock(const char *sLockname)
|
||||
{
|
||||
int fd;
|
||||
@ -344,17 +322,12 @@ bool GetLock(const char *sLockname)
|
||||
close(fd);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
void ClearLock(const char *sLockname)
|
||||
{
|
||||
unlink(sLockname);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
QString RDGetPathPart(QString path)
|
||||
@ -435,7 +408,6 @@ QFont::Weight RDGetFontWeight(QString string)
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
bool RDDetach(const QString &coredir)
|
||||
{
|
||||
if(!coredir.isEmpty()) {
|
||||
@ -446,7 +418,6 @@ bool RDDetach(const QString &coredir)
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
bool RDBool(QString string)
|
||||
@ -467,7 +438,6 @@ QString RDYesNo(bool state)
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
QHostAddress RDGetHostAddr()
|
||||
{
|
||||
FILE *file;
|
||||
@ -490,14 +460,10 @@ QHostAddress RDGetHostAddr()
|
||||
(host_ent->h_addr_list[0][3]&0xff);
|
||||
return QHostAddress((Q_UINT32)host_address);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
QString RDGetDisplay(bool strip_point)
|
||||
{
|
||||
#ifdef WIN32
|
||||
return QString("win32");
|
||||
#else
|
||||
QString display;
|
||||
int l;
|
||||
|
||||
@ -516,7 +482,6 @@ QString RDGetDisplay(bool strip_point)
|
||||
}
|
||||
}
|
||||
return display;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -775,7 +740,6 @@ int RDSetTimeLength(const QString &str)
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
bool RDCopy(const QString &srcfile,const QString &destfile)
|
||||
{
|
||||
int src_fd;
|
||||
@ -812,10 +776,8 @@ bool RDCopy(const QString &srcfile,const QString &destfile)
|
||||
close(dest_fd);
|
||||
return true;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
bool RDWritePid(const QString &dirname,const QString &filename,int owner,
|
||||
int group)
|
||||
{
|
||||
@ -881,7 +843,6 @@ bool RDTimeSynced()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
QString RDGetHomeDir(bool *found)
|
||||
@ -942,7 +903,6 @@ QString RDTempDir()
|
||||
|
||||
QString RDTempFile()
|
||||
{
|
||||
#ifndef WIN32
|
||||
int fd=-1;
|
||||
char dirname[PATH_MAX];
|
||||
strncpy(dirname,"/tmp/rivendellXXXXXX",PATH_MAX);
|
||||
@ -950,12 +910,10 @@ QString RDTempFile()
|
||||
close(fd);
|
||||
return QString(dirname);
|
||||
}
|
||||
#endif // WIN32
|
||||
return QString();
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
QString RDTimeZoneName(const QDateTime &datetime)
|
||||
{
|
||||
char name[20];
|
||||
@ -963,7 +921,6 @@ QString RDTimeZoneName(const QDateTime &datetime)
|
||||
strftime(name,20,"%Z",localtime(&time));
|
||||
return QString(name);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
QString RDDowCode(int dow)
|
||||
@ -1028,9 +985,6 @@ QTime RDUtcToLocal(const QTime &gmttime)
|
||||
|
||||
int RDTimeZoneOffset()
|
||||
{
|
||||
#ifdef WIN32
|
||||
return 0;
|
||||
#else
|
||||
time_t t=time(&t);
|
||||
struct tm *tm=localtime(&t);
|
||||
time_t local_time=3600*tm->tm_hour+60*tm->tm_min+tm->tm_sec;
|
||||
@ -1038,7 +992,6 @@ int RDTimeZoneOffset()
|
||||
time_t gmt_time=3600*tm->tm_hour+60*tm->tm_min+tm->tm_sec;
|
||||
|
||||
return gmt_time-local_time;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -1075,7 +1028,6 @@ bool RDProcessActive(const QString &cmd)
|
||||
|
||||
bool RDProcessActive(const QStringList &cmds)
|
||||
{
|
||||
#ifndef WIN32
|
||||
QStringList dirs;
|
||||
QDir *proc_dir=new QDir("/proc");
|
||||
bool ok=false;
|
||||
@ -1106,7 +1058,6 @@ bool RDProcessActive(const QStringList &cmds)
|
||||
}
|
||||
|
||||
delete proc_dir;
|
||||
#endif // WIN32
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -84,13 +84,11 @@ bool RDIsSqlNull(const QString &table,const QString &name,unsigned test,
|
||||
QString RDGetTimeLength(int mseconds,bool leadzero=false,bool tenths=true);
|
||||
int RDSetTimeLength(const QString &string);
|
||||
bool RDCopy(const QString &srcfile,const QString &destfile);
|
||||
#ifndef WIN32
|
||||
bool RDWritePid(const QString &dirname,const QString &filename,int owner=-1,
|
||||
int group=-1);
|
||||
void RDDeletePid(const QString &dirname,const QString &filename);
|
||||
bool RDCheckPid(const QString &dirname,const QString &filename);
|
||||
pid_t RDGetPid(const QString &pidfile);
|
||||
#endif // WIN32
|
||||
QString RDGetHomeDir(bool *found=0);
|
||||
bool RDTimeSynced();
|
||||
QString RDTruncateAfterWord(QString str,int word,bool add_dots=false);
|
||||
|
@ -18,7 +18,6 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <pwd.h>
|
||||
@ -27,7 +26,6 @@
|
||||
#include <arpa/inet.h>
|
||||
#include <net/if.h>
|
||||
#include <sys/ioctl.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qdatetime.h>
|
||||
#include <qmessagebox.h>
|
||||
@ -226,7 +224,6 @@ bool RDConfig::logXloadDebugData() const
|
||||
|
||||
void RDConfig::log(const QString &module,LogPriority prio,const QString &msg)
|
||||
{
|
||||
#ifndef WIN32
|
||||
QDateTime dt;
|
||||
QString filename;
|
||||
FILE *f=NULL;
|
||||
@ -263,7 +260,6 @@ void RDConfig::log(const QString &module,LogPriority prio,const QString &msg)
|
||||
case RDConfig::LogNone:
|
||||
break;
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -419,7 +415,6 @@ unsigned RDConfig::channels() const
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
uid_t RDConfig::uid() const
|
||||
{
|
||||
return conf_uid;
|
||||
@ -430,7 +425,6 @@ gid_t RDConfig::gid() const
|
||||
{
|
||||
return conf_gid;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
QString RDConfig::caeLogfile() const
|
||||
@ -507,20 +501,14 @@ void RDConfig::load()
|
||||
QString client;
|
||||
QString facility;
|
||||
QString iface;
|
||||
#ifndef WIN32
|
||||
struct passwd *user;
|
||||
struct group *groups;
|
||||
#endif
|
||||
|
||||
RDProfile *profile=new RDProfile();
|
||||
profile->setSource(conf_filename);
|
||||
#ifdef WIN32
|
||||
strcpy(sname,"windows");
|
||||
#else
|
||||
gethostname(sname,255);
|
||||
QStringList list=QString(sname).split("."); // Strip domain name parts
|
||||
strncpy(sname,list[0],256);
|
||||
#endif
|
||||
conf_station_name=
|
||||
profile->stringValue("Identity","StationName",sname);
|
||||
conf_password=profile->stringValue("Identity","Password","");
|
||||
@ -611,14 +599,12 @@ void RDConfig::load()
|
||||
conf_lock_rdairplay_memory=
|
||||
profile->boolValue("Hacks","LockRdairplayMemory",false);
|
||||
conf_channels=profile->intValue("Format","Channels",RD_DEFAULT_CHANNELS);
|
||||
#ifndef WIN32
|
||||
if((user=getpwnam(profile->stringValue("Identity","AudioOwner")))!=NULL) {
|
||||
conf_uid=user->pw_uid;
|
||||
}
|
||||
if((groups=getgrnam(profile->stringValue("Identity","AudioGroup")))!=NULL) {
|
||||
conf_gid=groups->gr_gid;
|
||||
}
|
||||
#endif
|
||||
conf_cae_logfile=profile->stringValue("Caed","Logfile","");
|
||||
conf_enable_mixer_logging=profile->boolValue("Caed","EnableMixerLogging");
|
||||
conf_use_realtime=profile->boolValue("Tuning","UseRealtime",false);
|
||||
@ -643,7 +629,6 @@ void RDConfig::load()
|
||||
//
|
||||
int sock=-1;
|
||||
|
||||
#ifndef WIN32
|
||||
if((sock=socket(PF_INET,SOCK_DGRAM,IPPROTO_IP))<0) {
|
||||
return;
|
||||
}
|
||||
@ -663,22 +648,12 @@ void RDConfig::load()
|
||||
ifr.ifr_ifindex=++index;
|
||||
}
|
||||
close(sock);
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
void RDConfig::clear()
|
||||
{
|
||||
#ifdef WIN32
|
||||
QSettings settings;
|
||||
settings.insertSearchPath(QSettings::Windows,"/SalemRadioLabs");
|
||||
conf_filename=QString().sprintf("%s\\%s",
|
||||
(const char *)settings.
|
||||
readEntry("/Rivendell/InstallDir"),
|
||||
(const char *)RD_WIN_CONF_FILE);
|
||||
#else
|
||||
conf_filename=RD_CONF_FILE;
|
||||
#endif
|
||||
conf_module_name="";
|
||||
conf_mysql_hostname="";
|
||||
conf_mysql_username="";
|
||||
@ -724,10 +699,8 @@ void RDConfig::clear()
|
||||
conf_disable_maint_checks=false;
|
||||
conf_lock_rdairplay_memory=false;
|
||||
conf_channels=RD_DEFAULT_CHANNELS;
|
||||
#ifndef WIN32
|
||||
conf_uid=65535;
|
||||
conf_gid=65535;
|
||||
#endif
|
||||
conf_cae_logfile="";
|
||||
conf_enable_mixer_logging=false;
|
||||
conf_use_realtime=false;
|
||||
|
@ -21,10 +21,8 @@
|
||||
#ifndef RDCONFIG_H
|
||||
#define RDCONFIG_H
|
||||
|
||||
#ifndef WIN32
|
||||
#include <syslog.h>
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -37,16 +35,10 @@ class RDConfig
|
||||
{
|
||||
public:
|
||||
enum LogFacility {LogNone=0,LogSyslog=1,LogFile=2};
|
||||
#ifdef WIN32
|
||||
enum LogPriority {LogEmerg=0,LogAlert=1,LogCrit=2,
|
||||
LogErr=3,LogWarning=4,LogNotice=5,
|
||||
LogInfo=6,LogDebug=7};
|
||||
#else
|
||||
enum LogPriority {LogEmerg=LOG_EMERG,LogAlert=LOG_ALERT,LogCrit=LOG_CRIT,
|
||||
LogErr=LOG_ERR,LogWarning=LOG_WARNING,LogNotice=LOG_NOTICE,
|
||||
LogInfo=LOG_INFO,LogDebug=LOG_DEBUG};
|
||||
|
||||
#endif // WIN32
|
||||
RDConfig();
|
||||
RDConfig(const QString &filename);
|
||||
QString filename() const;
|
||||
@ -102,10 +94,8 @@ class RDConfig
|
||||
QString caeLogfile() const;
|
||||
bool enableMixerLogging() const;
|
||||
unsigned channels() const;
|
||||
#ifndef WIN32
|
||||
uid_t uid() const;
|
||||
gid_t gid() const;
|
||||
#endif
|
||||
bool useRealtime();
|
||||
int realtimePriority();
|
||||
int transcodingDelay() const;
|
||||
@ -168,10 +158,8 @@ class RDConfig
|
||||
bool conf_lock_rdairplay_memory;
|
||||
std::vector<QString> conf_jack_ports[2];
|
||||
unsigned conf_channels;
|
||||
#ifndef WIN32
|
||||
uid_t conf_uid;
|
||||
gid_t conf_gid;
|
||||
#endif
|
||||
QString conf_cae_logfile;
|
||||
bool conf_enable_mixer_logging;
|
||||
bool conf_use_realtime;
|
||||
|
@ -18,9 +18,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
#include <fcntl.h>
|
||||
@ -31,9 +29,7 @@
|
||||
|
||||
#include <rd.h>
|
||||
#include <rdconf.h>
|
||||
#ifndef WIN32
|
||||
#include <rdwavefile.h>
|
||||
#endif
|
||||
|
||||
#include <rdcut.h>
|
||||
#include <rdtextvalidator.h>
|
||||
@ -863,9 +859,6 @@ void RDCut::logPlayout() const
|
||||
bool RDCut::copyTo(RDStation *station,RDUser *user,
|
||||
const QString &cutname,RDConfig *config) const
|
||||
{
|
||||
#ifdef WIN32
|
||||
return false;
|
||||
#else
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
RDSqlQuery *q1;
|
||||
@ -953,7 +946,6 @@ bool RDCut::copyTo(RDStation *station,RDUser *user,
|
||||
delete conv;
|
||||
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -1182,9 +1174,6 @@ bool RDCut::checkInRecording(const QString &station_name,
|
||||
RDSettings *settings,
|
||||
unsigned msecs) const
|
||||
{
|
||||
#ifdef WIN32
|
||||
return false;
|
||||
#else
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
int format;
|
||||
@ -1260,13 +1249,11 @@ bool RDCut::checkInRecording(const QString &station_name,
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
return true;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
void RDCut::autoTrim(RDCut::AudioEnd end,int level)
|
||||
{
|
||||
#ifndef WIN32
|
||||
int point;
|
||||
int start_point=0;
|
||||
int end_point=-1;
|
||||
@ -1318,14 +1305,12 @@ void RDCut::autoTrim(RDCut::AudioEnd end,int level)
|
||||
}
|
||||
setLength(end_point-start_point);
|
||||
delete wave;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
void RDCut::autoSegue(int level,int length,RDStation *station,RDUser *user,
|
||||
RDConfig *config)
|
||||
{
|
||||
#ifndef WIN32
|
||||
int point;
|
||||
// int start_point;
|
||||
|
||||
@ -1369,13 +1354,11 @@ void RDCut::autoSegue(int level,int length,RDStation *station,RDUser *user,
|
||||
}
|
||||
}
|
||||
delete wave;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
void RDCut::reset() const
|
||||
{
|
||||
#ifndef WIN32
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
int format;
|
||||
@ -1446,7 +1429,6 @@ void RDCut::reset() const
|
||||
delete q;
|
||||
wave->closeWave();
|
||||
delete wave;
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -1719,7 +1701,6 @@ void RDCut::GetDefaultDateTimes(QString *start_dt,QString *end_dt,
|
||||
|
||||
bool RDCut::FileCopy(const QString &srcfile,const QString &destfile) const
|
||||
{
|
||||
#ifndef WIN32
|
||||
int src_fd;
|
||||
int dest_fd;
|
||||
struct stat src_stat;
|
||||
@ -1763,7 +1744,7 @@ bool RDCut::FileCopy(const QString &srcfile,const QString &destfile) const
|
||||
free(buf);
|
||||
close(src_fd);
|
||||
close(dest_fd);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -57,9 +57,7 @@ RDSqlQuery::RDSqlQuery (const QString &query,bool reconnect):
|
||||
}
|
||||
|
||||
fprintf(stderr,"%s\n",(const char *)err);
|
||||
#ifndef WIN32
|
||||
syslog(LOG_ERR,(const char *)err);
|
||||
#endif
|
||||
}
|
||||
|
||||
if(isActive()) {
|
||||
@ -83,9 +81,7 @@ RDSqlQuery::RDSqlQuery (const QString &query,bool reconnect):
|
||||
+"["+lastError().text()+"]: "+query;
|
||||
|
||||
fprintf(stderr,"%s\n",(const char *)err);
|
||||
#ifndef WIN32
|
||||
syslog(LOG_ERR,(const char *)err);
|
||||
#endif // WIN32
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,13 +19,9 @@
|
||||
//
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qobject.h>
|
||||
//Added by qt3to4:
|
||||
#include <QSqlQuery>
|
||||
|
||||
#include <rdconf.h>
|
||||
#include <rdgroup.h>
|
||||
@ -271,7 +267,6 @@ int RDGroup::freeCartQuantity() const
|
||||
return free;
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
bool RDGroup::reserveCarts(std::vector<unsigned> *cart_nums,
|
||||
const QString &station_name,RDCart::Type type,
|
||||
unsigned quan) const
|
||||
@ -306,7 +301,7 @@ bool RDGroup::reserveCarts(std::vector<unsigned> *cart_nums,
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
bool RDGroup::cartNumberValid(unsigned cartnum) const
|
||||
{
|
||||
@ -441,7 +436,6 @@ unsigned RDGroup::GetNextFreeCart(unsigned startcart) const
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
bool RDGroup::ReserveCart(const QString &station_name,RDCart::Type type,
|
||||
unsigned cart_num) const
|
||||
{
|
||||
@ -467,7 +461,6 @@ bool RDGroup::ReserveCart(const QString &station_name,RDCart::Type type,
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
void RDGroup::SetRow(const QString ¶m,int value) const
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Abstract a Rivendell Service
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -60,20 +60,16 @@ class RDGroup
|
||||
void setColor(const QColor &color);
|
||||
unsigned nextFreeCart(unsigned startcart=0) const;
|
||||
int freeCartQuantity() const;
|
||||
#ifndef WIN32
|
||||
bool reserveCarts(std::vector<unsigned> *cart_nums,
|
||||
const QString &station_name,RDCart::Type type,
|
||||
unsigned quan) const;
|
||||
#endif // WIN32
|
||||
bool cartNumberValid(unsigned cartnum) const;
|
||||
QString xml() const;
|
||||
|
||||
private:
|
||||
unsigned GetNextFreeCart(unsigned startcart) const;
|
||||
#ifndef WIN32
|
||||
bool ReserveCart(const QString &station_name,RDCart::Type type,
|
||||
unsigned cart_num) const;
|
||||
#endif // WIN32
|
||||
void SetRow(const QString ¶m,int value) const;
|
||||
void SetRow(const QString ¶m,unsigned value) const;
|
||||
void SetRow(const QString ¶m,const QString &value) const;
|
||||
@ -82,4 +78,4 @@ class RDGroup
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // RDGROUP_H
|
||||
|
@ -446,7 +446,7 @@ QString RDLog::xml() const
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
QString ret;
|
||||
#ifndef WIN32
|
||||
|
||||
sql=QString("select ")+
|
||||
"NAME,"+ // 00
|
||||
"SERVICE,"+ // 01
|
||||
@ -491,7 +491,6 @@ QString RDLog::xml() const
|
||||
ret+=" </log>\n";
|
||||
}
|
||||
delete q;
|
||||
#endif // WIN32
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -18,9 +18,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <syslog.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qobject.h>
|
||||
|
||||
@ -1592,18 +1590,13 @@ RDLogLine::State RDLogLine::setEvent(int mach,RDLogLine::TransType next_type,
|
||||
cart=new RDCart(log_cart_number);
|
||||
if(!cart->exists()) {
|
||||
delete cart;
|
||||
#ifndef WIN32
|
||||
syslog(LOG_USER|LOG_WARNING,"RDLogLine::setEvent(): no such cart, CART=%06u",log_cart_number);
|
||||
#endif // WIN32
|
||||
log_state=RDLogLine::NoCart;
|
||||
return RDLogLine::NoCart;
|
||||
}
|
||||
cart->selectCut(&log_cut_name);
|
||||
if(log_cut_name.isEmpty()) {
|
||||
delete cart;
|
||||
#ifndef WIN32
|
||||
// syslog(LOG_USER|LOG_WARNING,"RDLogLine::setEvent(): RDCut::selectCut() failed, CART=%06u",log_cart_number);
|
||||
#endif // WIN32
|
||||
log_state=RDLogLine::NoCut;
|
||||
return RDLogLine::NoCut;
|
||||
}
|
||||
@ -1628,18 +1621,14 @@ RDLogLine::State RDLogLine::setEvent(int mach,RDLogLine::TransType next_type,
|
||||
if(!q->first()) {
|
||||
delete q;
|
||||
delete cart;
|
||||
#ifndef WIN32
|
||||
syslog(LOG_USER|LOG_WARNING,"RDLogLine::setEvent(): no cut record found, SQL=%s",(const char *)sql);
|
||||
#endif // WIN32
|
||||
log_state=RDLogLine::NoCut;
|
||||
return RDLogLine::NoCut;
|
||||
}
|
||||
if(q->value(0).toInt()==0) {
|
||||
delete q;
|
||||
delete cart;
|
||||
#ifndef WIN32
|
||||
syslog(LOG_USER|LOG_WARNING,"RDLogLine::setEvent(): zero length cut audio, SQL=%s",(const char *)sql);
|
||||
#endif // WIN32
|
||||
log_state=RDLogLine::NoCut;
|
||||
return RDLogLine::NoCut;
|
||||
}
|
||||
@ -1953,7 +1942,6 @@ void RDLogLine::refreshPointers()
|
||||
QString RDLogLine::xml(int line) const
|
||||
{
|
||||
QString ret;
|
||||
#ifndef WIN32
|
||||
ret+=" <logLine>\n";
|
||||
ret+=" "+RDXmlField("line",line);
|
||||
ret+=" "+RDXmlField("id",id());
|
||||
@ -2059,7 +2047,7 @@ QString RDLogLine::xml(int line) const
|
||||
ret+=" "+RDXmlField("extAnncType",extAnncType());
|
||||
|
||||
ret+=" </logLine>\n";
|
||||
#endif // WIN32
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -274,7 +274,6 @@ void RDLogeditConf::setDefaultTransType(RDLogLine::TransType type)
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
void RDLogeditConf::getSettings(RDSettings *s) const
|
||||
{
|
||||
QString sql;
|
||||
@ -313,7 +312,6 @@ void RDLogeditConf::getSettings(RDSettings *s) const
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
void RDLogeditConf::SetRow(const QString ¶m,int value) const
|
||||
|
@ -23,9 +23,7 @@
|
||||
|
||||
#include <qsqldatabase.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <rdsettings.h>
|
||||
#endif // WIN32
|
||||
#include <rdlog_line.h>
|
||||
|
||||
class RDLogeditConf
|
||||
@ -69,9 +67,7 @@ class RDLogeditConf
|
||||
void setRipperLevel(int level);
|
||||
RDLogLine::TransType defaultTransType() const;
|
||||
void setDefaultTransType(RDLogLine::TransType type);
|
||||
#ifndef WIN32
|
||||
void getSettings(RDSettings *s) const;
|
||||
#endif // WIN32
|
||||
|
||||
private:
|
||||
void SetRow(const QString ¶m,int value) const;
|
||||
@ -81,4 +77,4 @@ class RDLogeditConf
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
#endif // RDLOGEDIT_CONF_H
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include "rd.h"
|
||||
#include "rdescape_string.h"
|
||||
#include "rdlogfilter.h"
|
||||
//Added by qt3to4:
|
||||
|
||||
#include <QResizeEvent>
|
||||
#include <QLabel>
|
||||
#include "qlabel.h"
|
||||
|
||||
RDLogFilter::RDLogFilter(RDLogFilter::FilterMode mode,QWidget *parent)
|
||||
: QWidget(parent)
|
||||
@ -46,15 +46,6 @@ RDLogFilter::RDLogFilter(RDLogFilter::FilterMode mode,QWidget *parent)
|
||||
filter_service_label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
|
||||
filter_service_box=new QComboBox(this);
|
||||
filter_service_label->setBuddy(filter_service_box);
|
||||
#ifdef WIN32
|
||||
filter_service_box->insertItem(tr("ALL"));
|
||||
sql=QString("select NAME from SERVICES order by NAME");
|
||||
q=new RDSqlQuery(sql);
|
||||
while(q->next()) {
|
||||
filter_service_box->insertItem(q->value(0).toString());
|
||||
}
|
||||
delete q;
|
||||
#else
|
||||
switch(mode) {
|
||||
case RDLogFilter::NoFilter:
|
||||
filter_service_box->insertItem(tr("ALL"));
|
||||
@ -81,7 +72,6 @@ RDLogFilter::RDLogFilter(RDLogFilter::FilterMode mode,QWidget *parent)
|
||||
delete q;
|
||||
break;
|
||||
}
|
||||
#endif // WIN32
|
||||
connect(filter_service_box,SIGNAL(activated(int)),
|
||||
this,SLOT(serviceChangedData(int)));
|
||||
|
||||
|
@ -18,9 +18,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <syslog.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qdatetime.h>
|
||||
|
||||
@ -61,21 +59,11 @@ bool RDLogLock::tryLock(QString *username,QString *stationname,
|
||||
QHostAddress *addr)
|
||||
{
|
||||
bool ret=false;
|
||||
#ifdef WIN32
|
||||
QString guid=RDLogLock::makeGuid("windows");
|
||||
#else
|
||||
QString guid=RDLogLock::makeGuid(lock_station->name());
|
||||
#endif // WIN32
|
||||
|
||||
#ifdef WIN32
|
||||
*username="windows";
|
||||
*stationname="windows";
|
||||
#else
|
||||
*username=lock_user->name();
|
||||
*stationname=lock_station->name();
|
||||
addr->setAddress(lock_station->address().toString());
|
||||
#endif // WIN32
|
||||
|
||||
if(RDLogLock::tryLock(username,stationname,addr,lock_log_name,guid)) {
|
||||
lock_timer->start(RD_LOG_LOCK_TIMEOUT/2);
|
||||
lock_guid=guid;
|
||||
@ -156,12 +144,10 @@ void RDLogLock::updateLock(const QString &log_name,const QString &guid)
|
||||
"LOCK_DATETIME=now() where "+
|
||||
"LOCK_GUID=\""+RDEscapeString(guid)+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
#ifndef WIN32
|
||||
if(q->numRowsAffected()==0) {
|
||||
syslog(LOG_WARNING,"lock on log \"%s\" has evaporated!",
|
||||
(const char *)log_name);
|
||||
}
|
||||
#endif // WIN32
|
||||
delete q;
|
||||
}
|
||||
|
||||
|
@ -30,11 +30,6 @@
|
||||
|
||||
#include <rd.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <rdwin32.h>
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
class RDMacro
|
||||
{
|
||||
public:
|
||||
|
@ -310,13 +310,8 @@ RDReport::ErrorCode RDReport::errorCode() const
|
||||
bool RDReport::outputExists(const QDate &startdate)
|
||||
{
|
||||
QString out_path;
|
||||
#ifdef WIN32
|
||||
out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
#else
|
||||
out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
#endif
|
||||
return QFile::exists(out_path);
|
||||
}
|
||||
|
||||
@ -586,14 +581,8 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
|
||||
delete q;
|
||||
|
||||
bool ret=false;
|
||||
#ifdef WIN32
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Windows),startdate,
|
||||
report_station,report_config,serviceName());
|
||||
#else
|
||||
QString filename=RDDateDecode(exportPath(RDReport::Linux),startdate,
|
||||
report_station,report_config,serviceName());
|
||||
#endif
|
||||
|
||||
switch(filter()) {
|
||||
case RDReport::CbsiDeltaFlex:
|
||||
ret=ExportDeltaflex(filename,startdate,enddate,mixname);
|
||||
@ -665,17 +654,10 @@ bool RDReport::generateReport(const QDate &startdate,const QDate &enddate,
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
#ifdef WIN32
|
||||
*out_path=RDDateDecode(exportPath(RDReport::Windows),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
QString post_cmd=RDDateDecode(postExportCommand(RDReport::Windows),startdate,
|
||||
report_station,report_config,serviceName());
|
||||
#else
|
||||
*out_path=RDDateDecode(exportPath(RDReport::Linux),startdate,report_station,
|
||||
report_config,serviceName());
|
||||
QString post_cmd=RDDateDecode(postExportCommand(RDReport::Linux),startdate,
|
||||
report_station,report_config,serviceName());
|
||||
#endif
|
||||
system(post_cmd);
|
||||
sql=QString("delete from ELR_LINES where ")+
|
||||
"SERVICE_NAME=\""+RDEscapeString(mixname)+"\"";
|
||||
|
@ -338,9 +338,6 @@ QString RDSvc::importFilename(ImportSource src,const QDate &date) const
|
||||
break;
|
||||
}
|
||||
QString os_flag;
|
||||
#ifdef WIN32
|
||||
os_flag="_WIN";
|
||||
#endif
|
||||
QString sql=QString("select ")+
|
||||
src_str+os_flag+"_PATH from SERVICES where "+
|
||||
"NAME=\""+RDEscapeString(svc_name)+"\"";
|
||||
@ -392,13 +389,6 @@ bool RDSvc::import(ImportSource src,const QDate &date,const QString &break_str,
|
||||
break;
|
||||
}
|
||||
|
||||
//
|
||||
// Set OS Type
|
||||
//
|
||||
#ifdef WIN32
|
||||
os_flag="_WIN";
|
||||
#endif
|
||||
|
||||
//
|
||||
// Load Parser Parameters
|
||||
//
|
||||
@ -1035,7 +1025,6 @@ QString RDSvc::xml() const
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
QString ret;
|
||||
#ifndef WIN32
|
||||
sql="select DESCRIPTION from SERVICES where NAME=\""+
|
||||
RDEscapeString(svc_name)+"\"";
|
||||
|
||||
@ -1047,7 +1036,6 @@ QString RDSvc::xml() const
|
||||
ret+=" </service>\n";
|
||||
}
|
||||
delete q;
|
||||
#endif // WIN32
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// Securely create and then remove a temporary directory
|
||||
//
|
||||
// (C) Copyright 2017 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2017-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -20,9 +20,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qdatetime.h>
|
||||
#include <qstringlist.h>
|
||||
@ -61,17 +59,6 @@ QString RDTempDirectory::path() const
|
||||
|
||||
bool RDTempDirectory::create(QString *err_msg)
|
||||
{
|
||||
#ifdef WIN32
|
||||
QDateTime now=QDateTime::currentDateTime();
|
||||
QString tempdir=RDTempDirectory::basePath()+"/"+temp_base_name+
|
||||
QString().sprintf("%u",now.toTime_t());
|
||||
temp_dir=new QDir(tempdir);
|
||||
if(!temp_dir->mkdir(tempdir)) {
|
||||
*err_msg="unable to create temp directory";
|
||||
delete temp_dir;
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
char tempdir[PATH_MAX];
|
||||
|
||||
strncpy(tempdir,RDTempDirectory::basePath(),PATH_MAX);
|
||||
@ -83,7 +70,6 @@ bool RDTempDirectory::create(QString *err_msg)
|
||||
return false;
|
||||
}
|
||||
temp_dir=new QDir(tempdir);
|
||||
#endif // WIN32
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -95,18 +81,8 @@ QString RDTempDirectory::basePath()
|
||||
if (!conf_temp_directory.isEmpty()) {
|
||||
return conf_temp_directory;
|
||||
}
|
||||
#ifdef WIN32
|
||||
if(getenv("TEMP")!=NULL) {
|
||||
return QString(getenv("TEMP"));
|
||||
}
|
||||
if(getenv("TMP")!=NULL) {
|
||||
return QString(getenv("TMP"));
|
||||
}
|
||||
return QString("C:\\");
|
||||
#else
|
||||
if(getenv("TMPDIR")!=NULL) {
|
||||
return QString(getenv("TMPDIR"));
|
||||
}
|
||||
return QString("/tmp");
|
||||
#endif // WIN32
|
||||
}
|
||||
|
@ -18,9 +18,7 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@ -40,32 +38,11 @@ bool RDTextFile(const QString &data)
|
||||
QString editor;
|
||||
|
||||
if(getenv("VISUAL")==NULL) {
|
||||
#ifdef WIN32
|
||||
editor=RD_WIN32_EDITOR;
|
||||
#else
|
||||
editor=RD_LINUX_EDITOR;
|
||||
#endif // WIN32
|
||||
}
|
||||
else {
|
||||
editor=getenv("VISUAL");
|
||||
}
|
||||
#ifdef WIN32
|
||||
QString tempfile=RDTempDirectory::basePath()+"\\rd-"+
|
||||
QTime::currentTime().toString("hhmmsszzz");
|
||||
FILE *f=fopen(tempfile,"w");
|
||||
if(f==NULL) {
|
||||
QMessageBox::warning(NULL,"File Error","Unable to create temporary file");
|
||||
return false;
|
||||
}
|
||||
fprintf(f,"%s",(const char *)data.utf8());
|
||||
fclose(f);
|
||||
QStringList args;
|
||||
args+=editor;
|
||||
args+=tempfile;
|
||||
Q3Process *proc=new Q3Process(args);
|
||||
proc->launch("");
|
||||
delete proc;
|
||||
#else
|
||||
strcpy(tmpfile,RDTempDirectory::basePath()+"/rdreportXXXXXX");
|
||||
int fd=mkstemp(tmpfile);
|
||||
if(fd<0) {
|
||||
@ -79,6 +56,5 @@ bool RDTextFile(const QString &data)
|
||||
unlink(tmpfile);
|
||||
exit(0);
|
||||
}
|
||||
#endif // WIN32
|
||||
return true;
|
||||
}
|
||||
|
@ -22,12 +22,8 @@
|
||||
#ifndef RDTTYDEVICE_H
|
||||
#define RDTTYDEVICE_H
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <queue>
|
||||
|
||||
@ -35,8 +31,6 @@
|
||||
#include <qsocketnotifier.h>
|
||||
#include <qtimer.h>
|
||||
|
||||
#define WIN32_BUFFER_SIZE 130
|
||||
|
||||
class RDTTYDevice : public QIODevice
|
||||
{
|
||||
Q_OBJECT;
|
||||
@ -94,15 +88,9 @@ class RDTTYDevice : public QIODevice
|
||||
bool tty_open;
|
||||
int tty_flags;
|
||||
QIODevice::OpenMode tty_mode;
|
||||
#ifdef WIN32
|
||||
HANDLE tty_fd;
|
||||
int tty_speed;
|
||||
int tty_length;
|
||||
#else
|
||||
int tty_fd;
|
||||
speed_t tty_speed;
|
||||
tcflag_t tty_length;
|
||||
#endif // WIN32
|
||||
QSocketNotifier *tty_notifier;
|
||||
std::queue<char> tty_write_queue;
|
||||
QTimer *tty_write_timer;
|
||||
|
@ -80,7 +80,6 @@ bool RDUser::authenticated(bool webuser) const
|
||||
}
|
||||
delete q;
|
||||
}
|
||||
#ifndef WIN32
|
||||
else {
|
||||
bool ret=false;
|
||||
RDPam *pam=new RDPam(pamService());
|
||||
@ -88,7 +87,7 @@ bool RDUser::authenticated(bool webuser) const
|
||||
delete pam;
|
||||
return ret;
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A class for handling audio files.
|
||||
//
|
||||
// (C) Copyright 2002-2015 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// A class for handling Microsoft WAV files.
|
||||
//
|
||||
// (C) Copyright 2002-2004,2016 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 2002-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Library General Public License
|
||||
@ -25,9 +25,7 @@
|
||||
#include <vector>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
#include <qobject.h>
|
||||
#include <qstring.h>
|
||||
#include <qdatetime.h>
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Functions for interfacing with web components using the
|
||||
// Common Gateway Interface (CGI) Standard
|
||||
//
|
||||
// (C) Copyright 1996-2007,2017 Fred Gleason <fredg@paravelsystems.com>
|
||||
// (C) Copyright 1996-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License version 2 as
|
||||
@ -22,9 +22,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifndef WIN32
|
||||
#include <sys/time.h>
|
||||
#endif //WIN32
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
@ -37,13 +35,10 @@
|
||||
#include "rdescape_string.h"
|
||||
#include "rdtempdirectory.h"
|
||||
#include "rduser.h"
|
||||
#ifndef WIN32
|
||||
#include "rdwebresult.h"
|
||||
#endif // WIN32
|
||||
|
||||
#include "rdweb.h"
|
||||
|
||||
#ifndef WIN32
|
||||
/* RDReadPost(char *cBuffer,int dSize) */
|
||||
|
||||
/* This function reads POST data (such as that submitted by an HTML form) into
|
||||
@ -559,7 +554,6 @@ void RDCgiError(const char *str,int resp_code)
|
||||
}
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
extern void RDXMLResult(const char *str,int resp_code,
|
||||
RDAudioConvert::ErrorCode err)
|
||||
{
|
||||
@ -573,7 +567,6 @@ extern void RDXMLResult(const char *str,int resp_code,
|
||||
|
||||
exit(0);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
/*
|
||||
@ -876,8 +869,6 @@ bool RDParsePost(std::map<QString,QString> *vars)
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
QString RDXmlField(const QString &tag,const QString &value,const QString &attrs)
|
||||
{
|
||||
|
@ -29,9 +29,7 @@
|
||||
#include <qhostaddress.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <rdaudioconvert.h>
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Data Structure Sizes
|
||||
@ -42,7 +40,6 @@
|
||||
//
|
||||
// Function Prototypes
|
||||
//
|
||||
#ifndef WIN32
|
||||
extern int RDReadPost(char *,int);
|
||||
extern int RDPutPostString(char *,char *,char *,int);
|
||||
extern int RDFindPostString(const char *,const char *,char *,int);
|
||||
@ -56,10 +53,8 @@ extern int RDDecodeString(char *);
|
||||
extern int RDPutPlaintext(char *,int);
|
||||
extern int RDPurgePlaintext(char *,int);
|
||||
extern void RDCgiError(const char *str,int resp_code=200);
|
||||
#ifndef WIN32
|
||||
extern void RDXMLResult(const char *str,int resp_code,
|
||||
RDAudioConvert::ErrorCode err=RDAudioConvert::ErrorOk);
|
||||
#endif // WIN32
|
||||
extern int RDBufferDiff(char *,int,int,int);
|
||||
extern void RDPruneAmp(char *);
|
||||
extern int RDEscapeQuotes(const char *src,char *dest,int maxlen);
|
||||
@ -70,7 +65,6 @@ extern QString RDAuthenticateSession(long int session_id,
|
||||
const QHostAddress &addr);
|
||||
extern void RDLogoutSession(long int session_id,const QHostAddress &addr);
|
||||
extern bool RDParsePost(std::map<QString,QString> *vars);
|
||||
#endif // WIN32
|
||||
extern QString RDXmlField(const QString &tag,const QString &value,
|
||||
const QString &attrs="");
|
||||
extern QString RDXmlField(const QString &tag,const char *value,
|
||||
|
@ -18,12 +18,11 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qwindowsstyle.h>
|
||||
#include <qwidget.h>
|
||||
@ -105,17 +104,8 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
//
|
||||
// RIPC Connection
|
||||
//
|
||||
#ifndef WIN32
|
||||
connect(rda,SIGNAL(userChanged()),this,SLOT(userChangedData()));
|
||||
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// User
|
||||
//
|
||||
#ifdef WIN32
|
||||
rda->user()->setName(RD_USER_LOGIN_NAME);
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Create Fonts
|
||||
@ -333,15 +323,9 @@ int main(int argc,char *argv[])
|
||||
//
|
||||
QString tr_path;
|
||||
QString qt_path;
|
||||
#ifdef WIN32
|
||||
QSettings settings;
|
||||
settings.insertSearchPath(QSettings::Windows,"/SalemRadioLabs");
|
||||
tr_path=settings.readEntry("/Rivendell/InstallDir")+"\"";
|
||||
qt_path=tr_path;
|
||||
#else
|
||||
tr_path=QString(PREFIX)+QString("/share/rivendell/");
|
||||
qt_path=QString("/usr/share/qt4/translation/");
|
||||
#endif // WIN32
|
||||
|
||||
QTranslator qt(0);
|
||||
qt.load(qt_path+QString("qt_")+QTextCodec::locale(),".");
|
||||
a.installTranslator(&qt);
|
||||
|
@ -133,9 +133,8 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
||||
//
|
||||
// Dialogs
|
||||
//
|
||||
#ifndef WIN32
|
||||
edit_render_dialog=new RenderDialog(rda->station(),rda->system(),rda->config(),this);
|
||||
#endif // WIN32
|
||||
edit_render_dialog=
|
||||
new RenderDialog(rda->station(),rda->system(),rda->config(),this);
|
||||
|
||||
//
|
||||
// Text Validator
|
||||
@ -477,12 +476,10 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
||||
//
|
||||
// Render Button
|
||||
//
|
||||
#ifndef WIN32
|
||||
edit_renderas_button=new QPushButton(this);
|
||||
edit_renderas_button->setFont(button_font);
|
||||
edit_renderas_button->setText(tr("Render"));
|
||||
connect(edit_renderas_button,SIGNAL(clicked()),this,SLOT(renderasData()));
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Reports Button
|
||||
@ -495,14 +492,10 @@ EditLog::EditLog(QString logname,QString *filter,QString *group,
|
||||
//
|
||||
// Cart Player
|
||||
//
|
||||
#ifdef WIN32
|
||||
edit_player=NULL;
|
||||
#else
|
||||
edit_player=
|
||||
new RDSimplePlayer(rda->cae(),rda->ripc(),edit_output_card,edit_output_port,
|
||||
edit_start_macro,edit_end_macro,this);
|
||||
edit_player->stopButton()->setOnColor(Qt::red);
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Ok Button
|
||||
@ -855,7 +848,6 @@ void EditLog::insertMarkerButtonData()
|
||||
|
||||
void EditLog::clickedData(Q3ListViewItem *item)
|
||||
{
|
||||
#ifndef WIN32
|
||||
RDListViewItem *rditem=SingleSelection();
|
||||
if(rditem==NULL) {
|
||||
edit_player->setCart(0);
|
||||
@ -864,7 +856,6 @@ void EditLog::clickedData(Q3ListViewItem *item)
|
||||
else {
|
||||
edit_player->setCart(rditem->text(3).toUInt());
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -1178,7 +1169,6 @@ void EditLog::saveasData()
|
||||
|
||||
void EditLog::renderasData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
int first_line=-1;
|
||||
int last_line=-1;
|
||||
|
||||
@ -1200,7 +1190,6 @@ void EditLog::renderasData()
|
||||
else {
|
||||
edit_render_dialog->exec(rda->user(),edit_log_event,first_line,last_line+1);
|
||||
}
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -1236,9 +1225,7 @@ void EditLog::okData()
|
||||
SaveLog();
|
||||
DeleteTracks();
|
||||
}
|
||||
#ifndef WIN32
|
||||
edit_player->stop();
|
||||
#endif // WIN32
|
||||
for(unsigned i=0;i<edit_clipboard->size();i++) {
|
||||
edit_clipboard->at(i).clearExternalData();
|
||||
}
|
||||
@ -1269,9 +1256,7 @@ void EditLog::cancelData()
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifndef WIN32
|
||||
edit_player->stop();
|
||||
#endif // WIN32
|
||||
for(unsigned i=0;i<edit_clipboard->size();i++) {
|
||||
edit_clipboard->at(i).clearExternalData();
|
||||
}
|
||||
@ -1338,11 +1323,9 @@ void EditLog::resizeEvent(QResizeEvent *e)
|
||||
edit_save_button->setGeometry(10,size().height()-60,80,50);
|
||||
edit_saveas_button->setGeometry(100,size().height()-60,80,50);
|
||||
edit_reports_button->setGeometry(300,size().height()-60,80,50);
|
||||
#ifndef WIN32
|
||||
edit_renderas_button->setGeometry(190,size().height()-60,80,50);
|
||||
edit_player->playButton()->setGeometry(410,size().height()-60,80,50);
|
||||
edit_player->stopButton()->setGeometry(500,size().height()-60,80,50);
|
||||
#endif // WIN32
|
||||
edit_ok_button->
|
||||
setGeometry(size().width()-180,size().height()-60,80,50);
|
||||
edit_cancel_button->setGeometry(size().width()-90,size().height()-60,80,50);
|
||||
|
@ -45,9 +45,7 @@
|
||||
|
||||
#include "drop_listview.h"
|
||||
#include "list_reports.h"
|
||||
#ifndef WIN32
|
||||
#include "render_dialog.h"
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Widget Settings
|
||||
@ -197,10 +195,8 @@ class EditLog : public QDialog
|
||||
Q3DateEdit *edit_purgedate_edit;
|
||||
QPushButton *edit_purgedate_button;
|
||||
RDLogLock *edit_log_lock;
|
||||
#ifndef WIN32
|
||||
QPushButton *edit_renderas_button;
|
||||
RenderDialog *edit_render_dialog;
|
||||
#endif // WIN32
|
||||
};
|
||||
|
||||
|
||||
|
@ -18,12 +18,11 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qwindowsstyle.h>
|
||||
#include <qwidget.h>
|
||||
@ -56,9 +55,7 @@
|
||||
#include "edit_log.h"
|
||||
#include "globals.h"
|
||||
#include "rdlogedit.h"
|
||||
#ifndef WIN32
|
||||
#include "voice_tracker.h"
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Icons
|
||||
@ -116,24 +113,19 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
//
|
||||
// CAE Connection
|
||||
//
|
||||
#ifndef WIN32
|
||||
connect(rda->cae(),SIGNAL(isConnected(bool)),
|
||||
this,SLOT(caeConnectedData(bool)));
|
||||
rda->cae()->connectHost();
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// RIPC Connection
|
||||
//
|
||||
#ifndef WIN32
|
||||
connect(rda->ripc(),SIGNAL(connected(bool)),this,SLOT(connectedData(bool)));
|
||||
connect(rda->ripc(),SIGNAL(notificationReceived(RDNotification *)),
|
||||
this,SLOT(notificationReceivedData(RDNotification *)));
|
||||
connect(rda,SIGNAL(userChanged()),this,SLOT(userData()));
|
||||
rda->ripc()->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
||||
#else
|
||||
rdripc=NULL;
|
||||
#endif // WIN32
|
||||
rda->ripc()
|
||||
->connectHost("localhost",RIPCD_TCP_PORT,rda->config()->password());
|
||||
|
||||
//
|
||||
// Create Fonts
|
||||
@ -155,17 +147,10 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
log_greenball_map=new QPixmap(greenball_xpm);
|
||||
log_redball_map=new QPixmap(redball_xpm);
|
||||
|
||||
//
|
||||
// User
|
||||
//
|
||||
#ifndef WIN32
|
||||
//
|
||||
// Load Audio Assignments
|
||||
//
|
||||
RDSetMixerPorts(rda->config()->stationName(),rda->cae());
|
||||
#else
|
||||
rda->user()->setName(RD_USER_LOGIN_NAME);
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Log Filter
|
||||
@ -247,9 +232,6 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
log_track_button->setFont(button_font);
|
||||
log_track_button->setText(tr("Voice\n&Tracker"));
|
||||
connect(log_track_button,SIGNAL(clicked()),this,SLOT(trackData()));
|
||||
#ifdef WIN32
|
||||
log_track_button->hide();
|
||||
#endif
|
||||
|
||||
//
|
||||
// Log Report Button
|
||||
@ -267,9 +249,6 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
log_close_button->setText(tr("&Close"));
|
||||
connect(log_close_button,SIGNAL(clicked()),this,SLOT(quitMainWidget()));
|
||||
|
||||
#ifdef WIN32
|
||||
RefreshList();
|
||||
#endif // WIN32
|
||||
setWindowTitle(QString("RDLogEdit")+"v"+VERSION+" - "+tr("Host")+": "+
|
||||
rda->config()->stationName()+", "+
|
||||
tr("User")+": ["+tr("Unknown")+"]");
|
||||
@ -347,11 +326,7 @@ void MainWidget::addData()
|
||||
return;
|
||||
}
|
||||
delete log;
|
||||
#ifdef WIN32
|
||||
QString username(RD_USER_LOGIN_NAME);
|
||||
#else
|
||||
QString username(rda->ripc()->user());
|
||||
#endif // WIN32
|
||||
QString err_msg;
|
||||
if(!RDLog::create(logname,svcname,QDate(),username,&err_msg,
|
||||
rda->config())) {
|
||||
@ -503,7 +478,6 @@ void MainWidget::deleteData()
|
||||
|
||||
void MainWidget::trackData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
std::vector<ListListViewItem *> items;
|
||||
if(SelectedLogs(&items)!=1) {
|
||||
return;
|
||||
@ -514,7 +488,6 @@ void MainWidget::trackData()
|
||||
delete dialog;
|
||||
RefreshItem(items.at(0));
|
||||
UnlockList();
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -911,17 +884,10 @@ int main(int argc,char *argv[])
|
||||
//
|
||||
QString tr_path;
|
||||
QString qt_path;
|
||||
#ifdef WIN32
|
||||
QSettings settings;
|
||||
settings.insertSearchPath(QSettings::Windows,"/SalemRadioLabs");
|
||||
tr_path=QString().sprintf("%s\\",
|
||||
(const char *)settings.
|
||||
readEntry("/Rivendell/InstallDir"));
|
||||
qt_path=tr_path;
|
||||
#else
|
||||
|
||||
tr_path=QString(PREFIX)+QString("/share/rivendell/");
|
||||
qt_path=QString("/usr/share/qt4/translation/");
|
||||
#endif // WIN32
|
||||
|
||||
QTranslator qt(0);
|
||||
qt.load(qt_path+QString("qt_")+QTextCodec::locale(),".");
|
||||
a.installTranslator(&qt);
|
||||
|
@ -170,7 +170,6 @@ EditEvent::EditEvent(QString eventname,bool new_event,
|
||||
QString sql;
|
||||
RDSqlQuery *q;
|
||||
event_player = NULL;
|
||||
#ifndef WIN32
|
||||
sql=QString("select ")+
|
||||
"OUTPUT_CARD,"+ // 00
|
||||
"OUTPUT_PORT,"+ // 01
|
||||
@ -189,7 +188,6 @@ EditEvent::EditEvent(QString eventname,bool new_event,
|
||||
event_player->stopButton()->setOnColor(Qt::red);
|
||||
}
|
||||
delete q;
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Remarks
|
||||
@ -841,14 +839,12 @@ void EditEvent::filterClickedData(int id)
|
||||
|
||||
void EditEvent::cartClickedData(Q3ListViewItem *item)
|
||||
{
|
||||
#ifndef WIN32
|
||||
if (!event_player) return;
|
||||
if(item==NULL) {
|
||||
event_player->setCart(0);
|
||||
return;
|
||||
}
|
||||
event_player->setCart(item->text(1).toUInt());
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
@ -1224,22 +1220,19 @@ void EditEvent::colorData()
|
||||
void EditEvent::okData()
|
||||
{
|
||||
Save();
|
||||
#ifndef WIN32
|
||||
if (event_player){
|
||||
event_player->stop();
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
done(0);
|
||||
}
|
||||
|
||||
|
||||
void EditEvent::cancelData()
|
||||
{
|
||||
#ifndef WIN32
|
||||
if (event_player){
|
||||
event_player->stop();
|
||||
}
|
||||
#endif // WIN32
|
||||
if(event_saved) {
|
||||
done(-1);
|
||||
}
|
||||
|
@ -199,17 +199,10 @@ void PickReportDates::generateData()
|
||||
delete report;
|
||||
return;
|
||||
}
|
||||
#ifdef WIN32
|
||||
QString filename=
|
||||
RDDateDecode(report->exportPath(RDReport::Windows),
|
||||
edit_startdate_edit->date(),rda->station(),rda->config(),
|
||||
edit_svcname);
|
||||
#else
|
||||
QString filename=
|
||||
RDDateDecode(report->exportPath(RDReport::Linux),
|
||||
edit_startdate_edit->date(),rda->station(),rda->config(),
|
||||
edit_svcname);
|
||||
#endif
|
||||
QFile file(filename);
|
||||
if(file.exists()) {
|
||||
if(QMessageBox::question(this,"File Exists",
|
||||
|
@ -18,13 +18,12 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#endif // WIN32
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qwindowsstyle.h>
|
||||
#include <qwidget.h>
|
||||
@ -96,9 +95,7 @@ MainWidget::MainWidget(QWidget *parent)
|
||||
//
|
||||
// CAE Connection
|
||||
//
|
||||
#ifndef WIN32
|
||||
rda->cae()->connectHost();
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// RIPC Connection
|
||||
@ -285,17 +282,9 @@ int gui_main(int argc,char *argv[])
|
||||
//
|
||||
QString tr_path;
|
||||
QString qt_path;
|
||||
#ifdef WIN32
|
||||
QSettings settings;
|
||||
settings.insertSearchPath(QSettings::Windows,"/SalemRadioLabs");
|
||||
tr_path=QString().sprintf("%s\\",
|
||||
(const char *)settings.
|
||||
readEntry("/Rivendell/InstallDir"));
|
||||
qt_path=tr_path;
|
||||
#else
|
||||
tr_path=QString(PREFIX)+QString("/share/rivendell/");
|
||||
qt_path=QString("/usr/share/qt4/translation/");
|
||||
#endif // WIN32
|
||||
|
||||
QTranslator qt(0);
|
||||
qt.load(qt_path+QString("qt_")+QTextCodec::locale(),".");
|
||||
a.installTranslator(&qt);
|
||||
|
@ -72,10 +72,8 @@ SvcRecDialog::SvcRecDialog(const QString &svcname,QWidget *parent)
|
||||
date_delete_button->setFont(font);
|
||||
date_delete_button->setText(tr("&Purge\nData"));
|
||||
connect(date_delete_button,SIGNAL(clicked()),this,SLOT(deleteData()));
|
||||
#ifndef WIN32
|
||||
date_delete_button->setEnabled(rda->user()->deleteRec()&&
|
||||
date_picker->dayActive(date_picker->date().day()));
|
||||
#endif // WIN32
|
||||
|
||||
//
|
||||
// Close Button
|
||||
@ -109,13 +107,8 @@ QSizePolicy SvcRecDialog::sizePolicy() const
|
||||
|
||||
void SvcRecDialog::dateSelectedData(const QDate &,bool active)
|
||||
{
|
||||
#ifdef WIN32
|
||||
date_delete_button->
|
||||
setEnabled(date_picker->dayActive(date_picker->date().day()));
|
||||
#else
|
||||
date_delete_button->setEnabled(rda->user()->deleteRec()&&
|
||||
date_picker->dayActive(date_picker->date().day()));
|
||||
#endif // WIN32
|
||||
}
|
||||
|
||||
|
||||
|
@ -19,12 +19,10 @@
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#ifndef WIN32
|
||||
#include <netdb.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#include <qtranslator.h>
|
||||
#include <qapplication.h>
|
||||
@ -34,7 +32,6 @@
|
||||
#include <qpushbutton.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qsettings.h>
|
||||
//Added by qt3to4:
|
||||
#include <QCloseEvent>
|
||||
#include <QPixmap>
|
||||
|
||||
@ -197,7 +194,6 @@ QSizePolicy MainWidget::sizePolicy() const
|
||||
void MainWidget::buttonData(int id)
|
||||
{
|
||||
QHostAddress addr;
|
||||
#ifndef WIN32
|
||||
struct hostent *hostent=gethostbyname(key_addrs[id]);
|
||||
if(hostent==NULL) {
|
||||
QMessageBox::warning(this,tr("RDSoftKeys"),hstrerror(h_errno));
|
||||
@ -211,9 +207,6 @@ void MainWidget::buttonData(int id)
|
||||
else {
|
||||
addr.setAddress(key_addrs[id]);
|
||||
}
|
||||
#else
|
||||
addr.setAddress(key_addrs[id]);
|
||||
#endif // WIN32
|
||||
key_socket->writeBlock(key_macros[id],key_macros[id].length(),
|
||||
addr,(Q_UINT16)RD_RML_NOECHO_PORT);
|
||||
}
|
||||
@ -289,17 +282,10 @@ int main(int argc,char *argv[])
|
||||
//
|
||||
QString tr_path;
|
||||
QString qt_path;
|
||||
#ifdef WIN32
|
||||
QSettings settings;
|
||||
settings.insertSearchPath(QSettings::Windows,"/SalemRadioLabs");
|
||||
tr_path=QString().sprintf("%s\\",
|
||||
(const char *)settings.
|
||||
readEntry("/Rivendell/InstallDir"));
|
||||
qt_path=tr_path;
|
||||
#else
|
||||
|
||||
tr_path=QString(PREFIX)+QString("/share/srlabs/");
|
||||
qt_path=QString("/usr/share/qt4/translation/");
|
||||
#endif // WIN32
|
||||
|
||||
QTranslator qt(0);
|
||||
qt.load(qt_path+QString("qt_")+QTextCodec::locale(),".");
|
||||
a.installTranslator(&qt);
|
||||
|
@ -18,11 +18,18 @@
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
//
|
||||
|
||||
#ifndef WIN32
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <qapplication.h>
|
||||
#include <qwindowsstyle.h>
|
||||
@ -43,24 +50,11 @@
|
||||
#include <qtextcodec.h>
|
||||
#include <qtranslator.h>
|
||||
#include <qsettings.h>
|
||||
//Added by qt3to4:
|
||||
#include <QPixmap>
|
||||
|
||||
#include <rdcmd_switch.h>
|
||||
|
||||
#ifndef WIN32
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <netdb.h>
|
||||
#endif // WIN32
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <rmlsend.h>
|
||||
#include "rmlsend.h"
|
||||
|
||||
//
|
||||
// Icons
|
||||
@ -245,7 +239,6 @@ void MainWidget::sendCommand()
|
||||
break;
|
||||
}
|
||||
response->setText("");
|
||||
#ifndef WIN32
|
||||
struct hostent *hostent=gethostbyname(host->text());
|
||||
if(hostent==NULL) {
|
||||
QMessageBox::warning(this,tr("RMLSend"),hstrerror(h_errno));
|
||||
@ -259,9 +252,6 @@ void MainWidget::sendCommand()
|
||||
else {
|
||||
host_addr.setAddress(host->text());
|
||||
}
|
||||
#else
|
||||
host_addr.setAddress(host->text());
|
||||
#endif // WIN32
|
||||
dcl_command=command->text();
|
||||
if(!udp_command->writeBlock(dcl_command.utf8(),dcl_command.utf8().length(),
|
||||
host_addr,(Q_UINT16)port)) {
|
||||
@ -329,7 +319,6 @@ void MainWidget::destChangedData(int id)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
MainObject::MainObject(QObject *parent,const char *name)
|
||||
{
|
||||
input_fd=-1;
|
||||
@ -479,7 +468,7 @@ void MainObject::ProcessCommands()
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
int main(int argc,char *argv[])
|
||||
{
|
||||
@ -496,16 +485,10 @@ int main(int argc,char *argv[])
|
||||
cli_mode=true;
|
||||
}
|
||||
}
|
||||
#ifdef WIN32
|
||||
cli_mode=false;
|
||||
#endif // WIN32
|
||||
|
||||
if(cli_mode) {
|
||||
#ifndef WIN32
|
||||
QApplication a(argc,argv,false);
|
||||
new MainObject();
|
||||
return a.exec();
|
||||
#endif // WIN32
|
||||
}
|
||||
else {
|
||||
QApplication::setStyle(new QWindowsStyle);
|
||||
@ -516,17 +499,10 @@ int main(int argc,char *argv[])
|
||||
//
|
||||
QString tr_path;
|
||||
QString qt_path;
|
||||
#ifdef WIN32
|
||||
QSettings settings;
|
||||
settings.insertSearchPath(QSettings::Windows,"/SalemRadioLabs");
|
||||
tr_path=QString().sprintf("%s\\",
|
||||
(const char *)settings.
|
||||
readEntry("/Rivendell/InstallDir"));
|
||||
qt_path=tr_path;
|
||||
#else
|
||||
|
||||
tr_path=QString(PREFIX)+QString("/share/rivendell/");
|
||||
qt_path=QString("/usr/share/qt4/translation/");
|
||||
#endif // WIN32
|
||||
|
||||
QTranslator qt(0);
|
||||
qt.load(qt_path+QString("qt_")+QTextCodec::locale(),".");
|
||||
a.installTranslator(&qt);
|
||||
|
Loading…
x
Reference in New Issue
Block a user