Example #1
0
Vd80Err vd80SetClock(int fd, unsigned int mods, unsigned int chns, Vd80Input *inp) {

Vd80Err err;
int i, mod;
unsigned int mski;
int val;

   for (i=0; i<Vd80MODULES; i++) {
      mski = 1 << i;

      if (mods & mski) {
	 mod = i+1;
	 err = SetModule(fd,mod);
	 if (err != Vd80ErrSUCCESS) return err;

	 val = inp->Edge;
	 if (ioctl(fd,Vd80IoctlSET_CLOCK_EDGE       ,&val) < 0) return Vd80ErrIO;
	 val = inp->Termination;
	 if (ioctl(fd,Vd80IoctlSET_CLOCK_TERMINATION,&val) < 0) return Vd80ErrIO;
	 val = inp->Source;
	 if (ioctl(fd,Vd80IoctlSET_CLOCK            ,&val) < 0) return Vd80ErrIO;
      }
   }
   return Vd80ErrSUCCESS;
}
Example #2
0
Equalizer::Equalizer( Module &module ) :
	FFT_NBITS( 0 ), FFT_SIZE( 0 ), FFT_SIZE_2( 0 ),
	canFilter( false ), hasParameters( false ), enabled( false ),
	mutex( QMutex::Recursive ), fftIn( NULL ), fftOut( NULL )
{
	SetModule( module );
}
Example #3
0
GME::GME(Module &module) :
	m_srate(Functions::getBestSampleRate()),
	m_aborted(false),
	m_gme(NULL)
{
	SetModule(module);
}
Example #4
0
ImportFrom::ImportFrom(class Ast* ast, const location& loc, AstNode* _module,
		AstNode* _names, int level) :
	Stmt(AST_IMPORTFROM, ast, loc), level(level)
{
	SetModule(_module);
	SetNames(_names);
}
Example #5
0
DysonCompressor::DysonCompressor(Module &module) :
    enabled(false),
    channels(0),
    sampleRate(0)
{
    SetModule(module);
}
Example #6
0
Vd80Err vd80SetTriggerLevels(int fd, unsigned int mods, unsigned int chns, Vd80AnalogTrig *atrg) {

int i, j, mod, chn;
unsigned int mski, mskj;
Vd80Err err;
Vd80DrvrAnalogTrig adtrg;

   if (mods == Vd80ModNONE) mods = Vd80Mod01;
   if (chns == Vd80ChnNONE) chns = Vd80Chn01;

   for (i=0; i<Vd80MODULES; i++) {
      mski = 1 << i;

      if (mods & mski) {
	 mod = i+1;
	 err = SetModule(fd,mod);
	 if (err != Vd80ErrSUCCESS) return err;

	 for (j=0; j<Vd80CHANNELS; j++) {
	    mskj = 1 << j;

	    if (chns & mskj) {
	       chn = j+1;

	       adtrg.Channel = chn;
	       adtrg.Control = atrg->AboveBelow;
	       adtrg.Level   = atrg->TrigLevel;

	       if (ioctl(fd,Vd80IoctlSET_ANALOGUE_TRIGGER,&adtrg) < 0) return Vd80ErrIO;
	    }
	 }
      }
   }
   return Vd80ErrSUCCESS;
}
Example #7
0
SIDPlay::SIDPlay(Module &module) :
	m_srate(Functions::getBestSampleRate()),
	m_aborted(false),
	m_rs(NULL),
	m_tune(NULL)
{
	SetModule(module);
}
Example #8
0
MPDemux::MPDemux(Module &module) :
	aborted(false),
	pos(0.0),
	srate(Functions::getBestSampleRate()),
	mpfile(nullptr)
{
	SetModule(module);
}
Example #9
0
Vd80Err vd80GetBufferSize(int fd, unsigned int mod, int *post) {

Vd80Err err;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;
   if (ioctl(fd,Vd80IoctlGET_POSTSAMPLES,&post) < 0) return Vd80ErrIO;
   return Vd80ErrSUCCESS;
}
Example #10
0
Vd80Err vd80ResetMod(int fd, int mod) {

Vd80Err err;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;
   if (ioctl(fd,SkelDrvrIoctlRESET,NULL) < 0) return Vd80ErrIO;
   return Vd80ErrSUCCESS;
}
Example #11
0
Radio::Radio(Module &module) :
	once(false), net(NULL),
	qmp2Icon(QMPlay2Core.getQMPlay2Pixmap()),
	wlasneStacje(tr("Own radio stations"))
{
	SetModule(module);

	setContextMenuPolicy(Qt::CustomContextMenu);
	popupMenu.addAction(tr("Remove the radio station"), this, SLOT(removeStation()));

	dw = new DockWidget;
	dw->setWindowTitle(tr("Internet radios"));
	dw->setObjectName(RadioName);
	dw->setWidget(this);

	lW = new QListWidget;
	connect(lW, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(openLink()));
	lW->setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
	lW->setResizeMode(QListView::Adjust);
	lW->setWrapping(true);
	lW->setIconSize(QSize(32, 32));

	QAction *act = new QAction(lW);
	act->setShortcuts(QList<QKeySequence>() << QKeySequence("Return") << QKeySequence("Enter"));
	connect(act, SIGNAL(triggered()), this, SLOT(openLink()));
	act->setShortcutContext(Qt::WidgetWithChildrenShortcut);
	lW->addAction(act);

	infoL = new QLabel;

	progressB = new QProgressBar;

	QVBoxLayout *layout = new QVBoxLayout(this);
	layout->addWidget(lW);
	layout->addWidget(infoL);
	layout->addWidget(progressB);

	progressB->hide();

	connect(dw, SIGNAL(visibilityChanged(bool)), this, SLOT(visibilityChanged(bool)));
	connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(popup(const QPoint &)));

	addGroup(wlasneStacje);
	nowaStacjaLWI = new QListWidgetItem("-- " + tr("Add new radio station") + " --", lW);
	nowaStacjaLWI->setData(Qt::TextAlignmentRole, Qt::AlignCenter);

	Settings sets("Radio");
	foreach (const QString &entry, sets.get("Radia").toStringList())
	{
		const QStringList nazwa_i_adres = entry.split('\n');
		if (nazwa_i_adres.count() == 2)
			addStation(nazwa_i_adres[0], nazwa_i_adres[1], wlasneStacje);
	}
}
Example #12
0
Vd80Err vd80GetClockDivide(int fd, int mod, int chn, unsigned int *dvd) {

Vd80Err err;
int val;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   if (ioctl(fd,Vd80IoctlGET_CLOCK_DIVISOR,&val) < 0) return Vd80ErrIO;
   *dvd = val;
   return Vd80ErrSUCCESS;
}
Example #13
0
ALSAWriter::ALSAWriter(Module &module) :
	snd(NULL),
	delay(0.0),
	sample_rate(0), channels(0),
	autoFindMultichannelDevice(false), err(false)
{
	addParam("delay");
	addParam("rate");
	addParam("chn");

	SetModule(module);
}
Example #14
0
Vd80Err vd80GetStatus(int fd, int mod, Vd80Status *sts) {

Vd80Err err;
int val;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   if (ioctl(fd, SkelDrvrIoctlGET_STATUS, &val) < 0) return Vd80ErrIO;
   *sts = (Vd80Status) val;
   return Vd80ErrSUCCESS;
}
Example #15
0
Vd80Err vd80GetState(int fd, int mod, int chn, Vd80State *ste) {

Vd80Err err;
int val;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   if (ioctl(fd,Vd80IoctlGET_STATE,&val) < 0) return Vd80ErrIO;
   *ste = (Vd80State) val;
   return Vd80ErrSUCCESS;
}
Example #16
0
LastFM::LastFM( Module &module ) :
	coverReply( NULL ),
	loginReply( NULL ),
	scrobbleReply( NULL ),
	dontShowLoginError( false ),
	firstTime( true )
{
	SetModule( module );
	updateTim.setSingleShot( true );
	loginTimer.setSingleShot( true );
	connect( &updateTim, SIGNAL( timeout() ), this, SLOT( processScrobbleQueue() ) );
	connect( &loginTimer, SIGNAL( timeout() ), this, SLOT( login() ) );
	connect( &QMPlay2Core, SIGNAL( updatePlaying( bool, QString, QString, QString, int, bool, QString ) ), this, SLOT( updatePlaying( bool, QString, QString, QString, int, bool, QString ) ) );
}
Example #17
0
Vd80Err vd80GetVersion(int fd, int mod, Vd80Version *ver) {

Vd80Err err;
SkelDrvrVersion skver;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   if (ioctl(fd,SkelDrvrIoctlGET_VERSION,&skver) < 0) return Vd80ErrIO;

   ver->LibraryVersion = COMPILE_TIME;
   ver->DriverVersion  = skver.DriverVersion;
   strncpy(ver->ModVersion,skver.ModuleVersion,Vd80VERSION_SIZE);
   return Vd80ErrSUCCESS;
}
Example #18
0
Vd80Err vd80GetAdcValue(int fd, int mod, int chn, int *adc) {

Vd80Err err;
int val;
short sval;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   val = chn;
   if (ioctl(fd,Vd80IoctlREAD_ADC,&val) < 0) return Vd80ErrIO;
   sval = val & 0xFFFF;
   *adc = sval;
   return Vd80ErrSUCCESS;
}
Example #19
0
OpenGL2Writer::OpenGL2Writer(Module &module)
	: drawable(nullptr)
	, allowPBO(true)
	, forceRtt(false)
{
	addParam("W");
	addParam("H");
	addParam("AspectRatio");
	addParam("Zoom");
	addParam("Spherical");
	addParam("Flip");
	addParam("Rotate90");
	addParam("ResetOther");

	SetModule(module);
}
Example #20
0
Vd80Err vd80GetClock(int fd, int mod, int chn, Vd80Input *inp) {

Vd80Err err;
int val;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   if (ioctl(fd,Vd80IoctlGET_CLOCK_EDGE       ,&val) < 0) return Vd80ErrIO;
   inp->Edge = val;
   if (ioctl(fd,Vd80IoctlGET_CLOCK_TERMINATION,&val) < 0) return Vd80ErrIO;
   inp->Termination = val;
   if (ioctl(fd,Vd80IoctlGET_CLOCK            ,&val) < 0) return Vd80ErrIO;
   inp->Source = val;

   return Vd80ErrSUCCESS;
}
Example #21
0
static int DoCommand(int fd, int mod, int chn, int cmd) {

Vd80Err err;
int val;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   val = cmd;
   if (cmd == VD80_COMMAND_READ) {
      val |= (VD80_OPERANT_MASK & ((chn -1) << VD80_OPERANT_SHIFT));
   }

   if (ioctl(fd,Vd80IoctlSET_COMMAND,&val) < 0) return Vd80ErrIO;

   return Vd80ErrSUCCESS;
}
Example #22
0
Vd80Err vd80GetTriggerConfig(int fd, int mod, int chn, Vd80TrigConfig *ctrg) {

Vd80Err err;
Vd80DrvrTrigConfig cdtrg;

   if (mod == Vd80ModNONE) mod = Vd80Mod01;
   if (chn == Vd80ChnNONE) chn = Vd80Chn01;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   if (ioctl(fd,Vd80IoctlGET_TRIGGER_CONFIG,&cdtrg) < 0) return Vd80ErrIO;

   ctrg->TrigDelay  = cdtrg.TrigDelay;
   ctrg->MinPreTrig = cdtrg.MinPreTrig;

   return Vd80ErrSUCCESS;
}
Example #23
0
std::string SwordFuncs::parseInput(char *input) {
  std::string str = input;
  if (str.compare(0, 2, "??") == 0) {
    std::cout << "perform global search" << std::endl;
  } else if (str.compare(0, 1, "?") == 0) {
    std::cout << "perform search within module" << std::endl;
  } else if (str.compare(0, 1, "!") == 0) {
    std::string mod = str.substr(1);
    trim(mod);
    SetModule(mod);
  } else if (str.empty()) {
    if (vkey.isTraversable()) {
      vkey++;
    }
  } else {
    return lookup(str);
  }
  return currentText();
}
Example #24
0
VAApiWriter::VAApiWriter( Module &module ) :
	ok( false ),
	VADisp( NULL ),
	rgbImgFmt( NULL ),
	aspect_ratio( 0.0 ), zoom( 0.0 ),
	outW( 0 ), outH( 0 ), Hue( 0 ), Saturation( 0 ), Brightness( 0 ), Contrast( 0 )
#ifdef HAVE_VPP
	, vpp_deint_type( VAProcDeinterlacingNone ),
	use_vpp( false )
#endif
{
	vaImg.image_id = vaSubpicID = 0;

	setAttribute( Qt::WA_OpaquePaintEvent );
	setAttribute( Qt::WA_PaintOnScreen );
	setMouseTracking( true );

	SetModule( module );
}
Example #25
0
Vd80Err vd80SetBufferSize(int fd, unsigned int mods, unsigned int chns, int bsze, int post) {

int i, mod;
unsigned int mski;
Vd80Err err;

   for (i=0; i<Vd80MODULES; i++) {
      mski = 1 << i;

      if (mods & mski) {
	 mod = i+1;
	 err = SetModule(fd,mod);
	 if (err != Vd80ErrSUCCESS) return err;

	 if (ioctl(fd,Vd80IoctlSET_POSTSAMPLES,&post) < 0) return Vd80ErrIO;
      }
   }
   return Vd80ErrSUCCESS;
}
Example #26
0
Vd80Err vd80GetTriggerLevels(int fd, int mod, int chn, Vd80AnalogTrig *atrg) {

Vd80Err err;
Vd80DrvrAnalogTrig adtrg;

   if (mod == Vd80ModNONE) mod = Vd80Mod01;
   if (chn == Vd80ChnNONE) chn = Vd80Chn01;

   err = SetModule(fd,mod);
   if (err != Vd80ErrSUCCESS) return err;

   adtrg.Channel = chn;

   if (ioctl(fd,Vd80IoctlGET_ANALOGUE_TRIGGER,&adtrg) < 0) return Vd80ErrIO;

   atrg->AboveBelow = adtrg.Control;
   atrg->TrigLevel  = adtrg.Level;

   return Vd80ErrSUCCESS;
}
Example #27
0
void Clock::KeyDown( int keyCode )
{
	if( keyCode == SDLK_ESCAPE )
		running = 0;

	if( keyCode == SDLK_UP )
		increaseMusicVolume();
	if( keyCode == SDLK_DOWN )
		decreaseMusicVolume();

	if( keyCode == SDLK_LALT )
	{
		if( lastVolumeOut == 0 )
		{
			lastVolumeOut = time(0);
			volDecreaseRate = 15.0f * (1.0f / BASS_GetVolume());
			dimMode = 1;
			curSettings->SetBrightness( curSettings->dimmedBrightness );
		} else {
			lastVolumeOut = 0;
			dimMode = 0;
			curSettings->SetBrightness( curSettings->normalBrightness );
		}
		forceRedraw = 1;
	}

	if( keyCode == SDLK_LCTRL )
	{
		dimMode = 1 - dimMode;
		forceRedraw = 1;
		if( dimMode == 0 )
			curSettings->SetBrightness( curSettings->normalBrightness );
		else
			curSettings->SetBrightness( curSettings->dimmedBrightness );
	}

	if( keyCode == SDLK_a )
		SetModule( (Module*)new SetAlarms() );
}
Example #28
0
Vd80Err vd80SetClockDivide(int fd, unsigned int mods, unsigned int chns, unsigned int dvd) {

int i, mod;
unsigned int mski;
int val;
Vd80Err err;

   for (i=0; i<Vd80MODULES; i++) {
      mski = 1 << i;

      if (mods & mski) {
	 mod = i+1;
	 err = SetModule(fd,mod);
	 if (err != Vd80ErrSUCCESS) return err;

	 val = VD80_CLKDIVMODE_DIVIDE;
	 if (ioctl(fd,Vd80IoctlSET_CLOCK_DIVIDE_MODE,&val) < 0) return Vd80ErrIO;

	 val = dvd;
	 if (ioctl(fd,Vd80IoctlSET_CLOCK_DIVISOR,&val) < 0) return Vd80ErrIO;
      }
   }
   return Vd80ErrSUCCESS;
}
Example #29
0
Vd80Err vd80SetTriggerConfig(int fd, unsigned int mods, unsigned int chns, Vd80TrigConfig *ctrg) {

int i, j, mod, chn;
unsigned int mski, mskj;
Vd80Err err;
Vd80DrvrTrigConfig cdtrg;

   if (mods == Vd80ModNONE) mods = Vd80Mod01;
   if (chns == Vd80ChnNONE) chns = Vd80Chn01;

   for (i=0; i<Vd80MODULES; i++) {
      mski = 1 << i;

      if (mods & mski) {
	 mod = i+1;
	 err = SetModule(fd,mod);
	 if (err != Vd80ErrSUCCESS) return err;

	 for (j=0; j<Vd80CHANNELS; j++) {
	    mskj = 1 << j;

	    if (chns & mskj) {
	       chn = j+1;

	       cdtrg.TrigDelay  = ctrg->TrigDelay;
	       cdtrg.MinPreTrig = ctrg->MinPreTrig;

	       if (ioctl(fd,Vd80IoctlSET_TRIGGER_CONFIG,&cdtrg) < 0)
		  return Vd80ErrIO;
	       break;
	    }
	 }
      }
   }
   return Vd80ErrSUCCESS;
}
Example #30
0
Vd80Err vd80Connect(int fd, unsigned int mods, unsigned int chns, unsigned int imsk) {

SkelDrvrConnection conn;

int i, mod;
unsigned int mski;
Vd80Err err;

   for (i=0; i<Vd80MODULES; i++) {
      mski = 1 << i;

      if (mods & mski) {
	 mod = i+1;
	 err = SetModule(fd,mod);
	 if (err != Vd80ErrSUCCESS) return err;

	 conn.Module  = mod;
	 conn.ConMask = imsk;
	 if (ioctl(fd,SkelDrvrIoctlCONNECT, &conn) < 0) return Vd80ErrIO;

      }
   }
   return Vd80ErrSUCCESS;
}