mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-04-12 07:42:35 +02:00
2017-09-01 Fred Gleason <fredg@paravelsystems.com>
* Added 'src_hostname' and 'user_name' parameters to the 'RDCut::checkInRecording()' method in 'lib/rdcut.cpp' and 'lib/rdcut.h'.
This commit is contained in:
parent
167b30b046
commit
83428bb153
@ -16007,3 +16007,7 @@
|
||||
* Fixed a bug in 'rdlibrary/record_cut.cpp' that caused the 'Weight'
|
||||
control to fail to be disabled when the cut was placed in evergreen
|
||||
mode.
|
||||
2017-09-01 Fred Gleason <fredg@paravelsystems.com>
|
||||
* Added 'src_hostname' and 'user_name' parameters to the
|
||||
'RDCut::checkInRecording()' method in 'lib/rdcut.cpp' and
|
||||
'lib/rdcut.h'.
|
||||
|
@ -1199,7 +1199,10 @@ void RDCut::setMetadata(RDWaveData *data) const
|
||||
}
|
||||
|
||||
|
||||
bool RDCut::checkInRecording(const QString &stationname,RDSettings *settings,
|
||||
bool RDCut::checkInRecording(const QString &station_name,
|
||||
const QString &user_name,
|
||||
QString src_hostname,
|
||||
RDSettings *settings,
|
||||
unsigned msecs) const
|
||||
{
|
||||
#ifdef WIN32
|
||||
@ -1209,6 +1212,38 @@ bool RDCut::checkInRecording(const QString &stationname,RDSettings *settings,
|
||||
RDSqlQuery *q;
|
||||
int format;
|
||||
QString hash;
|
||||
QHostAddress addr;
|
||||
|
||||
QString user="null";
|
||||
if(!user_name.isEmpty()) {
|
||||
user="\""+RDEscapeString(user_name)+"\"";
|
||||
}
|
||||
|
||||
//
|
||||
// Attempt to resolve IP address
|
||||
//
|
||||
if(addr.setAddress(src_hostname)) {
|
||||
if(addr.isIPv4Address()) {
|
||||
QStringList f0=f0.split(".",addr.toString());
|
||||
if(f0[0]=="127") {
|
||||
src_hostname=station_name;
|
||||
}
|
||||
else {
|
||||
sql=QString("select NAME from STATIONS where ")+
|
||||
"IPV4_ADDRESS=\""+RDEscapeString(addr.toString())+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
if(q->first()) {
|
||||
src_hostname=q->value(0).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(addr.isIPv6Address()) {
|
||||
QStringList f0=f0.split(":",addr.toString());
|
||||
if(f0.back()=="1") {
|
||||
src_hostname=station_name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch(settings->format()) {
|
||||
case RDSettings::MpegL2:
|
||||
@ -1219,29 +1254,31 @@ bool RDCut::checkInRecording(const QString &stationname,RDSettings *settings,
|
||||
format=0;
|
||||
break;
|
||||
}
|
||||
sql=QString().sprintf("update CUTS set START_POINT=0,END_POINT=%d,\
|
||||
FADEUP_POINT=-1,FADEDOWN_POINT=-1,\
|
||||
SEGUE_START_POINT=-1,SEGUE_END_POINT=-1,\
|
||||
TALK_START_POINT=-1,TALK_END_POINT=-1,\
|
||||
HOOK_START_POINT=-1,HOOK_END_POINT=-1,\
|
||||
PLAY_GAIN=0,PLAY_COUNTER=0,LOCAL_COUNTER=0,\
|
||||
CODING_FORMAT=%d,SAMPLE_RATE=%d,\
|
||||
BIT_RATE=%d,CHANNELS=%d,LENGTH=%d,\
|
||||
ORIGIN_DATETIME=\"%s %s\",ORIGIN_NAME=\"%s\",\
|
||||
UPLOAD_DATETIME=null \
|
||||
where CUT_NAME=\"%s\"",
|
||||
msecs,
|
||||
format,
|
||||
settings->sampleRate(),
|
||||
settings->bitRate(),
|
||||
settings->channels(),
|
||||
msecs,
|
||||
(const char *)QDate::currentDate().
|
||||
toString("yyyy-MM-dd"),
|
||||
(const char *)QTime::currentTime().
|
||||
toString("hh:mm:ss"),
|
||||
(const char *)stationname,
|
||||
(const char *)cut_name);
|
||||
sql=QString("update CUTS set ")+
|
||||
"START_POINT=0,"+
|
||||
QString().sprintf("END_POINT=%d,",msecs)+
|
||||
"FADEUP_POINT=-1,"+
|
||||
"FADEDOWN_POINT=-1,"+
|
||||
"SEGUE_START_POINT=-1,"+
|
||||
"SEGUE_END_POINT=-1,"+
|
||||
"TALK_START_POINT=-1,"+
|
||||
"TALK_END_POINT=-1,"+
|
||||
"HOOK_START_POINT=-1,"+
|
||||
"HOOK_END_POINT=-1,"+
|
||||
"PLAY_GAIN=0,"+
|
||||
"PLAY_COUNTER=0,"+
|
||||
"LOCAL_COUNTER=0,"+
|
||||
QString().sprintf("CODING_FORMAT=%d,",format)+
|
||||
QString().sprintf("SAMPLE_RATE=%d,",settings->sampleRate())+
|
||||
QString().sprintf("BIT_RATE=%d,",settings->bitRate())+
|
||||
QString().sprintf("CHANNELS=%d,",settings->channels())+
|
||||
QString().sprintf("LENGTH=%d,",msecs)+
|
||||
"ORIGIN_DATETIME=now(),"+
|
||||
"ORIGIN_NAME=\""+RDEscapeString(station_name)+"\","+
|
||||
"ORIGIN_LOGIN_NAME="+user+","+
|
||||
"SOURCE_HOSTNAME=\""+RDEscapeString(src_hostname)+"\","+
|
||||
"UPLOAD_DATETIME=null "+
|
||||
"where CUT_NAME=\""+cut_name+"\"";
|
||||
q=new RDSqlQuery(sql);
|
||||
delete q;
|
||||
return true;
|
||||
|
@ -134,7 +134,8 @@ class RDCut
|
||||
RDConfig *config) const;
|
||||
void getMetadata(RDWaveData *data) const;
|
||||
void setMetadata(RDWaveData *data) const;
|
||||
bool checkInRecording(const QString &stationname,RDSettings *settings,
|
||||
bool checkInRecording(const QString &station_name,const QString &user_name,
|
||||
QString src_hostname,RDSettings *settings,
|
||||
unsigned msecs) const;
|
||||
void autoTrim(RDCut::AudioEnd end,int level);
|
||||
void autoSegue(int level,int length,RDStation *station,RDUser *user,
|
||||
|
@ -2395,7 +2395,8 @@ void MainObject::CheckInRecording(QString cutname,CatchEvent *evt,
|
||||
s->setSampleRate(evt->sampleRate());
|
||||
s->setBitRate(evt->bitrate());
|
||||
s->setChannels(evt->channels());
|
||||
cut->checkInRecording(catch_config->stationName(),s,msecs);
|
||||
cut->checkInRecording(catch_config->stationName(),"",
|
||||
catch_config->stationName(),s,msecs);
|
||||
cut->setSha1Hash(RDSha1Hash(RDCut::pathName(cut->cutName())));
|
||||
delete s;
|
||||
cut->autoTrim(RDCut::AudioBoth,-threshold);
|
||||
|
@ -817,7 +817,8 @@ void RecordCut::recordUnloadedData(int card,int stream,unsigned len)
|
||||
s->setBitRate(rec_bitrate);
|
||||
s->setChannels(rec_channels);
|
||||
s->setFormat((RDSettings::Format)rec_format);
|
||||
rec_cut->checkInRecording(rdstation_conf->name(),s,len);
|
||||
rec_cut->checkInRecording(rdstation_conf->name(),lib_user->name(),
|
||||
rdstation_conf->name(),s,len);
|
||||
RDRehash::rehash(rdstation_conf,lib_user,lib_config,rec_cut->cartNumber(),
|
||||
rec_cut->cutNumber());
|
||||
if(rec_trim_box->currentItem()==0) {
|
||||
|
@ -1873,7 +1873,8 @@ void VoiceTracker::recordUnloadedData(int card,int stream,unsigned msecs)
|
||||
track_recording=false;
|
||||
if(!track_aborting) {
|
||||
edit_track_cuts[1]->
|
||||
checkInRecording(rdstation_conf->name(),edit_settings,msecs);
|
||||
checkInRecording(rdstation_conf->name(),rduser->name(),
|
||||
rdstation_conf->name(),edit_settings,msecs);
|
||||
RDRehash::rehash(rdstation_conf,rduser,log_config,
|
||||
edit_track_cuts[1]->cartNumber(),
|
||||
edit_track_cuts[1]->cutNumber());
|
||||
|
@ -40,6 +40,19 @@ void Xport::Import()
|
||||
unsigned length_deviation=0;
|
||||
unsigned msecs=0;
|
||||
int resp_code=0;
|
||||
QString remote_host;
|
||||
|
||||
if(getenv("REMOTE_HOST")==NULL) {
|
||||
if(getenv("REMOTE_ADDR")==NULL) {
|
||||
XmlExit("Internal server error",500,"import.cpp",LINE_NUMBER);
|
||||
}
|
||||
else {
|
||||
remote_host=getenv("REMOTE_ADDR");
|
||||
}
|
||||
}
|
||||
else {
|
||||
remote_host=getenv("REMOTE_HOST");
|
||||
}
|
||||
|
||||
//
|
||||
// Verify Post
|
||||
@ -198,13 +211,11 @@ void Xport::Import()
|
||||
XmlExit("Unable to access imported file",500,"import.cpp",LINE_NUMBER);
|
||||
}
|
||||
delete wave;
|
||||
cut->checkInRecording(xport_config->stationName(),settings,msecs);
|
||||
cut->checkInRecording(xport_config->stationName(),xport_user->name(),
|
||||
remote_host,settings,msecs);
|
||||
if(use_metadata>0) {
|
||||
cart->setMetadata(conv->sourceWaveData());
|
||||
cut->setMetadata(conv->sourceWaveData());
|
||||
syslog(LOG_NOTICE,"SOURCE: title: %s startDateTime: %s %s",
|
||||
(const char *)conv->sourceWaveData()->title(),
|
||||
(const char *)conv->sourceWaveData()->startDate().toString("yyyy-MM-dd"),(const char *)conv->sourceWaveData()->startTime().toString("hh:mm:ss"));
|
||||
}
|
||||
if(autotrim_level!=0) {
|
||||
cut->autoTrim(RDCut::AudioBoth,100*autotrim_level);
|
||||
|
Loading…
x
Reference in New Issue
Block a user