mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-06-05 06:32:34 +02:00
Use RdCart.selectCut in RDSimplePlayer instead of using first non empty Cut
This commit is contained in:
parent
f920917832
commit
20c3812d3d
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <rddb.h>
|
#include <rddb.h>
|
||||||
#include <rdsimpleplayer.h>
|
#include <rdsimpleplayer.h>
|
||||||
|
#include <rdcart.h>
|
||||||
|
|
||||||
RDSimplePlayer::RDSimplePlayer(RDCae *cae,RDRipc *ripc,int card,int port,
|
RDSimplePlayer::RDSimplePlayer(RDCae *cae,RDRipc *ripc,int card,int port,
|
||||||
unsigned start_cart,unsigned end_cart,
|
unsigned start_cart,unsigned end_cart,
|
||||||
@ -114,18 +114,22 @@ void RDSimplePlayer::play(int start_pos)
|
|||||||
if(play_is_playing) {
|
if(play_is_playing) {
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
sql=QString().sprintf("select CUT_NAME,START_POINT,END_POINT,PLAY_GAIN\
|
|
||||||
from CUTS where (CART_NUMBER=%u)&&(LENGTH>0)",
|
QString cut = "";
|
||||||
play_cart);
|
RDCart *cart=new RDCart(play_cart);
|
||||||
q=new RDSqlQuery(sql);
|
if (cart->selectCut(&cut)) {
|
||||||
if(q->first()) {
|
|
||||||
play_cae->
|
play_cae->
|
||||||
loadPlay(play_card,q->value(0).toString(),&play_stream,&handle);
|
loadPlay(play_card,cut,&play_stream,&handle);
|
||||||
play_cut_gain=q->value(3).toInt();
|
|
||||||
if(play_stream<0) {
|
if(play_stream<0) {
|
||||||
delete q;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sql=QString().sprintf("select START_POINT,END_POINT,PLAY_GAIN \
|
||||||
|
from CUTS where CUT_NAME='%s'", (const char *)cut);
|
||||||
|
q=new RDSqlQuery(sql);
|
||||||
|
if(q->first()) {
|
||||||
|
play_cut_gain=q->value(2).toInt();
|
||||||
play_handles.push(handle);
|
play_handles.push(handle);
|
||||||
for(int i=0;i<RD_MAX_PORTS;i++) {
|
for(int i=0;i<RD_MAX_PORTS;i++) {
|
||||||
play_cae->setOutputVolume(play_card,play_stream,i,RD_MUTE_DEPTH);
|
play_cae->setOutputVolume(play_card,play_stream,i,RD_MUTE_DEPTH);
|
||||||
@ -133,12 +137,14 @@ void RDSimplePlayer::play(int start_pos)
|
|||||||
play_cae->setOutputVolume(play_card,play_stream,play_port,0+play_cut_gain);
|
play_cae->setOutputVolume(play_card,play_stream,play_port,0+play_cut_gain);
|
||||||
play_cae->positionPlay(play_handles.back(),q->value(1).toUInt()+start_pos);
|
play_cae->positionPlay(play_handles.back(),q->value(1).toUInt()+start_pos);
|
||||||
play_cae->play(play_handles.back(),
|
play_cae->play(play_handles.back(),
|
||||||
q->value(2).toUInt()-(q->value(1).toUInt()+start_pos),
|
q->value(1).toUInt()-(q->value(0).toUInt()+start_pos),
|
||||||
RD_TIMESCALE_DIVISOR,false);
|
RD_TIMESCALE_DIVISOR,false);
|
||||||
play_cae->setPlayPortActive(play_card,play_port,play_stream);
|
play_cae->setPlayPortActive(play_card,play_port,play_stream);
|
||||||
}
|
}
|
||||||
delete q;
|
delete q;
|
||||||
}
|
}
|
||||||
|
delete cart;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void RDSimplePlayer::stop()
|
void RDSimplePlayer::stop()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user