mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-23 09:18:34 +02:00
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
* Refactored the RDAudioInfo class to use RDApplication.
This commit is contained in:
parent
bdb4283794
commit
f75ba3297d
@ -16683,3 +16683,5 @@
|
|||||||
* Refactored the RDCutDialog class to use RDApplication.
|
* Refactored the RDCutDialog class to use RDApplication.
|
||||||
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
|
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
|
||||||
* Refactored the RDAddLog class to use RDApplication.
|
* Refactored the RDAddLog class to use RDApplication.
|
||||||
|
2018-02-06 Fred Gleason <fredg@paravelsystems.com>
|
||||||
|
* Refactored the RDAudioInfo class to use RDApplication.
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Get information about a cut in the audio store.
|
// Get information about a cut in the audio store.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2011,2016-2017 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2011,2016-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -30,10 +30,11 @@
|
|||||||
|
|
||||||
#include <qstringlist.h>
|
#include <qstringlist.h>
|
||||||
|
|
||||||
#include <rd.h>
|
#include "rd.h"
|
||||||
#include <rdxport_interface.h>
|
#include "rdapplication.h"
|
||||||
#include <rdformpost.h>
|
#include "rdxport_interface.h"
|
||||||
#include <rdaudioinfo.h>
|
#include "rdformpost.h"
|
||||||
|
#include "rdaudioinfo.h"
|
||||||
|
|
||||||
size_t RDAudioInfoCallback(void *ptr,size_t size,size_t nmemb,void *userdata)
|
size_t RDAudioInfoCallback(void *ptr,size_t size,size_t nmemb,void *userdata)
|
||||||
{
|
{
|
||||||
@ -45,11 +46,9 @@ size_t RDAudioInfoCallback(void *ptr,size_t size,size_t nmemb,void *userdata)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
RDAudioInfo::RDAudioInfo(RDStation *station,RDConfig *config,QObject *parent)
|
RDAudioInfo::RDAudioInfo(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
{
|
{
|
||||||
conv_station=station;
|
|
||||||
conv_config=config;
|
|
||||||
conv_cart_number=0;
|
conv_cart_number=0;
|
||||||
conv_cut_number=0;
|
conv_cut_number=0;
|
||||||
conv_format=RDWaveFile::Pcm16;
|
conv_format=RDWaveFile::Pcm16;
|
||||||
@ -135,14 +134,14 @@ RDAudioInfo::ErrorCode RDAudioInfo::runInfo(const QString &username,
|
|||||||
// otherwise some versions of LibCurl will throw a 'bad/illegal format'
|
// otherwise some versions of LibCurl will throw a 'bad/illegal format'
|
||||||
// error.
|
// error.
|
||||||
//
|
//
|
||||||
strncpy(url,conv_station->webServiceUrl(conv_config),1024);
|
strncpy(url,rda->station()->webServiceUrl(rda->config()),1024);
|
||||||
curl_easy_setopt(curl,CURLOPT_URL,url);
|
curl_easy_setopt(curl,CURLOPT_URL,url);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,RDAudioInfoCallback);
|
curl_easy_setopt(curl,CURLOPT_WRITEFUNCTION,RDAudioInfoCallback);
|
||||||
curl_easy_setopt(curl,CURLOPT_WRITEDATA,&conv_xml);
|
curl_easy_setopt(curl,CURLOPT_WRITEDATA,&conv_xml);
|
||||||
curl_easy_setopt(curl,CURLOPT_POST,1);
|
curl_easy_setopt(curl,CURLOPT_POST,1);
|
||||||
curl_easy_setopt(curl,CURLOPT_POSTFIELDS,(const char *)post);
|
curl_easy_setopt(curl,CURLOPT_POSTFIELDS,(const char *)post);
|
||||||
curl_easy_setopt(curl,CURLOPT_USERAGENT,
|
curl_easy_setopt(curl,CURLOPT_USERAGENT,
|
||||||
(const char *)conv_config->userAgent());
|
(const char *)rda->config()->userAgent());
|
||||||
curl_easy_setopt(curl,CURLOPT_TIMEOUT,RD_CURL_TIMEOUT);
|
curl_easy_setopt(curl,CURLOPT_TIMEOUT,RD_CURL_TIMEOUT);
|
||||||
|
|
||||||
switch(curl_err=curl_easy_perform(curl)) {
|
switch(curl_err=curl_easy_perform(curl)) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Get information about a cut in the audio store.
|
// Get information about a cut in the audio store.
|
||||||
//
|
//
|
||||||
// (C) Copyright 2011,2016 Fred Gleason <fredg@paravelsystems.com>
|
// (C) Copyright 2011,2016-2018 Fred Gleason <fredg@paravelsystems.com>
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or modify
|
// 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
|
// it under the terms of the GNU General Public License version 2 as
|
||||||
@ -23,9 +23,7 @@
|
|||||||
|
|
||||||
#include <qobject.h>
|
#include <qobject.h>
|
||||||
|
|
||||||
#include <rdconfig.h>
|
|
||||||
#include <rdwavefile.h>
|
#include <rdwavefile.h>
|
||||||
#include <rdstation.h>
|
|
||||||
|
|
||||||
class RDAudioInfo : public QObject
|
class RDAudioInfo : public QObject
|
||||||
{
|
{
|
||||||
@ -33,7 +31,7 @@ class RDAudioInfo : public QObject
|
|||||||
public:
|
public:
|
||||||
enum ErrorCode {ErrorOk=0,ErrorInternal=5,ErrorUrlInvalid=7,
|
enum ErrorCode {ErrorOk=0,ErrorInternal=5,ErrorUrlInvalid=7,
|
||||||
ErrorService=8,ErrorInvalidUser=9,ErrorNoAudio=10};
|
ErrorService=8,ErrorInvalidUser=9,ErrorNoAudio=10};
|
||||||
RDAudioInfo(RDStation *station,RDConfig *config,QObject *parent=0);
|
RDAudioInfo(QObject *parent=0);
|
||||||
RDWaveFile::Format format() const;
|
RDWaveFile::Format format() const;
|
||||||
unsigned channels() const;
|
unsigned channels() const;
|
||||||
unsigned sampleRate() const;
|
unsigned sampleRate() const;
|
||||||
@ -48,8 +46,6 @@ class RDAudioInfo : public QObject
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
int ParseInt(const QString &tag,const QString &xml);
|
int ParseInt(const QString &tag,const QString &xml);
|
||||||
RDStation *conv_station;
|
|
||||||
RDConfig *conv_config;
|
|
||||||
unsigned conv_cart_number;
|
unsigned conv_cart_number;
|
||||||
unsigned conv_cut_number;
|
unsigned conv_cut_number;
|
||||||
RDWaveFile::Format conv_format;
|
RDWaveFile::Format conv_format;
|
||||||
|
@ -109,7 +109,7 @@ RDEditAudio::RDEditAudio(RDCart *cart,QString cut_name,RDCae *cae,RDUser *user,
|
|||||||
this,SLOT(positionData(int,unsigned)));
|
this,SLOT(positionData(int,unsigned)));
|
||||||
edit_cae->loadPlay(edit_card,edit_cut->cutName(),&edit_stream,&edit_handle);
|
edit_cae->loadPlay(edit_card,edit_cut->cutName(),&edit_stream,&edit_handle);
|
||||||
RDSetMixerOutputPort(edit_cae,edit_card,edit_stream,edit_port);
|
RDSetMixerOutputPort(edit_cae,edit_card,edit_stream,edit_port);
|
||||||
RDAudioInfo *info=new RDAudioInfo(station,edit_config,this);
|
RDAudioInfo *info=new RDAudioInfo(this);
|
||||||
RDAudioInfo::ErrorCode audio_err;
|
RDAudioInfo::ErrorCode audio_err;
|
||||||
info->setCartNumber(RDCut::cartNumber(cut_name));
|
info->setCartNumber(RDCut::cartNumber(cut_name));
|
||||||
info->setCutNumber(RDCut::cutNumber(cut_name));
|
info->setCutNumber(RDCut::cutNumber(cut_name));
|
||||||
|
@ -114,8 +114,7 @@ bool MainObject::ValidateGroup(const QString &groupname,
|
|||||||
bool ret=true;
|
bool ret=true;
|
||||||
QString sql;
|
QString sql;
|
||||||
RDSqlQuery *q;
|
RDSqlQuery *q;
|
||||||
// RDStation *station=new RDStation(rda->config()->stationName());
|
RDAudioInfo *info=new RDAudioInfo(this);
|
||||||
RDAudioInfo *info=new RDAudioInfo(rda->station(),rda->config());
|
|
||||||
RDAudioInfo::ErrorCode err_code;
|
RDAudioInfo::ErrorCode err_code;
|
||||||
|
|
||||||
sql=QString("select CUTS.CUT_NAME,CUTS.CART_NUMBER,CUTS.LENGTH ")+
|
sql=QString("select CUTS.CUT_NAME,CUTS.CART_NUMBER,CUTS.LENGTH ")+
|
||||||
|
@ -352,7 +352,7 @@ void MainObject::ExportCut(RDCart *cart,RDCut *cut)
|
|||||||
//
|
//
|
||||||
// Get Audio Parameters
|
// Get Audio Parameters
|
||||||
//
|
//
|
||||||
RDAudioInfo *info=new RDAudioInfo(rda->station(),rda->config());
|
RDAudioInfo *info=new RDAudioInfo(this);
|
||||||
info->setCartNumber(cart->number());
|
info->setCartNumber(cart->number());
|
||||||
info->setCutNumber(RDCut::cutNumber(cut->cutName()));
|
info->setCutNumber(RDCut::cutNumber(cut->cutName()));
|
||||||
if((info_err=info->runInfo(rda->user()->name(),rda->user()->password()))!=
|
if((info_err=info->runInfo(rda->user()->name(),rda->user()->password()))!=
|
||||||
|
@ -308,7 +308,7 @@ void MainObject::ClearAutoTrim(unsigned cartnum,int cutnum,const QString &title,
|
|||||||
RDAudioInfo::ErrorCode err;
|
RDAudioInfo::ErrorCode err;
|
||||||
RDCart *cart=new RDCart(cartnum);
|
RDCart *cart=new RDCart(cartnum);
|
||||||
RDCut *cut=new RDCut(cartnum,cutnum);
|
RDCut *cut=new RDCut(cartnum,cutnum);
|
||||||
RDAudioInfo *info=new RDAudioInfo(rda->station(),rda->config(),this);
|
RDAudioInfo *info=new RDAudioInfo(this);
|
||||||
info->setCartNumber(cartnum);
|
info->setCartNumber(cartnum);
|
||||||
info->setCutNumber(cutnum);
|
info->setCutNumber(cutnum);
|
||||||
if((err=info->runInfo(rda->user()->name(),rda->user()->password()))==
|
if((err=info->runInfo(rda->user()->name(),rda->user()->password()))==
|
||||||
|
Loading…
x
Reference in New Issue
Block a user