| 252 | | if( sActionString == "STRIP_VOLUME_ABSOLUTE" ){ |
| | 252 | |
| | 253 | if( sActionString == "EFFECT1_LEVEL_ABSOLUTE" ){ |
| | 254 | bool ok; |
| | 255 | int nLine = pAction->getParameter1().toInt(&ok,10); |
| | 256 | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| | 257 | setAbsoluteFXLevel( nLine, 0 , fx_param ); |
| | 258 | } |
| | 259 | |
| | 260 | if( sActionString == "EFFECT2_LEVEL_ABSOLUTE" ){ |
| | 261 | bool ok; |
| | 262 | int nLine = pAction->getParameter1().toInt(&ok,10); |
| | 263 | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| | 264 | setAbsoluteFXLevel( nLine, 1 , fx_param ); |
| | 265 | } |
| | 266 | |
| | 267 | if( sActionString == "EFFECT3_LEVEL_ABSOLUTE" ){ |
| | 268 | bool ok; |
| | 269 | int nLine = pAction->getParameter1().toInt(&ok,10); |
| | 270 | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| | 271 | setAbsoluteFXLevel( nLine, 2 , fx_param ); |
| | 272 | } |
| | 273 | |
| | 274 | if( sActionString == "EFFECT4_LEVEL_ABSOLUTE" ){ |
| | 275 | bool ok; |
| | 276 | int nLine = pAction->getParameter1().toInt(&ok,10); |
| | 277 | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| | 278 | setAbsoluteFXLevel( nLine, 3 , fx_param ); |
| | 279 | } |
| | 280 | |
| | 281 | |
| | 282 | |
| | 283 | |
| | 284 | |
| | 285 | if( sActionString == "MASTER_VOLUME_RELATIVE" ){ |
| | 286 | //increments/decrements the volume of the whole song |
| | 287 | |
| | 288 | bool ok; |
| | 289 | int vol_param = pAction->getParameter2().toInt(&ok,10); |
| | 290 | |
| | 291 | Hydrogen *engine = Hydrogen::get_instance(); |
| | 292 | Song *song = engine->getSong(); |
| | 293 | |
| | 294 | |
| | 295 | |
| | 296 | if( vol_param != 0 ){ |
| | 297 | if ( vol_param == 1 && song->get_volume() < 1.5 ){ |
| | 298 | song->set_volume( song->get_volume() + 0.05 ); |
| | 299 | } else { |
| | 300 | if( song->get_volume() >= 0.0 ){ |
| | 301 | song->set_volume( song->get_volume() - 0.05 ); |
| | 302 | } |
| | 303 | } |
| | 304 | } else { |
| | 305 | song->set_volume( 0 ); |
| | 306 | } |
| | 307 | |
| | 308 | } |
| | 309 | |
| | 310 | if( sActionString == "MASTER_VOLUME_ABSOLUTE" ){ |
| 304 | | if( sActionString == "EFFECT1_LEVEL_ABSOLUTE" ){ |
| 305 | | bool ok; |
| 306 | | int nLine = pAction->getParameter1().toInt(&ok,10); |
| 307 | | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| 308 | | setAbsoluteFXLevel( nLine, 0 , fx_param ); |
| 309 | | } |
| 310 | | |
| 311 | | if( sActionString == "EFFECT2_LEVEL_ABSOLUTE" ){ |
| 312 | | bool ok; |
| 313 | | int nLine = pAction->getParameter1().toInt(&ok,10); |
| 314 | | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| 315 | | setAbsoluteFXLevel( nLine, 1 , fx_param ); |
| 316 | | } |
| 317 | | |
| 318 | | if( sActionString == "EFFECT3_LEVEL_ABSOLUTE" ){ |
| 319 | | bool ok; |
| 320 | | int nLine = pAction->getParameter1().toInt(&ok,10); |
| 321 | | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| 322 | | setAbsoluteFXLevel( nLine, 2 , fx_param ); |
| 323 | | } |
| 324 | | |
| 325 | | if( sActionString == "EFFECT4_LEVEL_ABSOLUTE" ){ |
| 326 | | bool ok; |
| 327 | | int nLine = pAction->getParameter1().toInt(&ok,10); |
| 328 | | int fx_param = pAction->getParameter2().toInt(&ok,10); |
| 329 | | setAbsoluteFXLevel( nLine, 3 , fx_param ); |
| 330 | | } |
| 331 | | |
| 332 | | |
| 333 | | |
| 334 | | |
| 335 | | |
| 336 | | if( sActionString == "MASTER_VOLUME_RELATIVE" ){ |
| 337 | | //increments/decrements the volume of the whole song |
| 338 | | |
| 339 | | bool ok; |
| 340 | | int vol_param = pAction->getParameter2().toInt(&ok,10); |
| 341 | | |
| 342 | | Hydrogen *engine = Hydrogen::get_instance(); |
| 343 | | Song *song = engine->getSong(); |
| 344 | | |
| 345 | | |
| 346 | | |
| 347 | | if( vol_param != 0 ){ |
| 348 | | if ( vol_param == 1 && song->get_volume() < 1.5 ){ |
| 349 | | song->set_volume( song->get_volume() + 0.05 ); |
| 350 | | } else { |
| 351 | | if( song->get_volume() >= 0.0 ){ |
| 352 | | song->set_volume( song->get_volume() - 0.05 ); |
| 353 | | } |
| 354 | | } |
| 355 | | } else { |
| 356 | | song->set_volume( 0 ); |
| 357 | | } |
| 358 | | |
| 359 | | } |
| 360 | | |
| 361 | | if( sActionString == "MASTER_VOLUME_ABSOLUTE" ){ |
| 362 | | //sets the volume of a mixer strip to a given level (percentage) |
| 363 | | |
| 364 | | bool ok; |
| 365 | | int nLine = pAction->getParameter1().toInt(&ok,10); |
| 366 | | int vol_param = pAction->getParameter2().toInt(&ok,10); |
| 367 | | |
| 368 | | |
| 369 | | Hydrogen *engine = Hydrogen::get_instance(); |
| 370 | | Song *song = engine->getSong(); |
| 371 | | |
| 372 | | |
| 373 | | if( vol_param != 0 ){ |
| 374 | | song->set_volume( 1.5* ( (float) (vol_param / 127.0 ) )); |
| 375 | | } else { |
| 376 | | song->set_volume( 0 ); |
| 377 | | } |
| 378 | | |
| 379 | | } |
| 380 | | |
| 381 | | if( sActionString == "STRIP_VOLUME_RELATIVE" ){ |
| 382 | | //increments/decrements the volume of one mixer strip |
| 383 | | |
| 384 | | bool ok; |
| 385 | | int nLine = pAction->getParameter1().toInt(&ok,10); |
| 386 | | int vol_param = pAction->getParameter2().toInt(&ok,10); |
| 387 | | |
| 388 | | Hydrogen::get_instance()->setSelectedInstrumentNumber( nLine ); |
| 389 | | |
| 390 | | Hydrogen *engine = Hydrogen::get_instance(); |
| 391 | | Song *song = engine->getSong(); |
| 392 | | InstrumentList *instrList = song->get_instrument_list(); |
| 393 | | |
| 394 | | Instrument *instr = instrList->get( nLine ); |
| 395 | | |
| 396 | | if ( instr == NULL) return 0; |
| 397 | | |
| 398 | | if( vol_param != 0 ){ |
| 399 | | if ( vol_param == 1 && instr->get_volume() < 1.5 ){ |
| 400 | | instr->set_volume( instr->get_volume() + 0.1 ); |
| 401 | | } else { |
| 402 | | if( instr->get_volume() >= 0.0 ){ |
| 403 | | instr->set_volume( instr->get_volume() - 0.1 ); |
| 404 | | } |
| 405 | | } |
| 406 | | } else { |
| 407 | | instr->set_volume( 0 ); |
| 408 | | } |
| 409 | | |
| 410 | | Hydrogen::get_instance()->setSelectedInstrumentNumber(nLine); |
| 411 | | } |
| 412 | | |