| 804 | | //my personal ratio quality settings |
| 805 | | //ratios < 0.1 || > 3.0 are bad (red) or experimental sounds |
| 806 | | //ratios > 0.1 - 0.5 || > 2.0 are middle (yellow) |
| 807 | | //ratios < 0.5 || < 2.0 are good (green) |
| 808 | | |
| 809 | | bool is_green = false; |
| 810 | | //green ratio |
| 811 | | if( (m_pratio >= 0.5) && (m_pratio <= 2.0) ){ |
| 812 | | rubberComboBox->setStyleSheet("QComboBox { background-color: green; }"); |
| 813 | | is_green = true; |
| 814 | | } |
| 815 | | //yellow ratio |
| 816 | | if( ( (m_pratio > 0.1) || ( m_pratio <= 3.0 ) )&& (!is_green)){ |
| 817 | | rubberComboBox->setStyleSheet("QComboBox { background-color: yellow; }"); |
| 818 | | } |
| 819 | | //red ratio |
| 820 | | if( ( m_pratio <= 0.1 ) || ( m_pratio > 3.0 ) && (!is_green) ){ |
| 821 | | rubberComboBox->setStyleSheet("QComboBox { background-color: red; }"); |
| 822 | | } |
| 823 | | QString text = QString( " RB-Ratio = %1").arg(m_pratio); |
| 824 | | ratiolabel->setText( text ); |
| 825 | | |
| 826 | | //no rubberband = default |
| 827 | | if( !__rubberband.use ){ |
| 828 | | rubberComboBox->setStyleSheet("QComboBox { background-color: 58, 62, 72; }"); |
| 829 | | ratiolabel->setText( "" ); |
| 830 | | } |
| | 804 | //calculate ration |
| | 805 | double durationtime = 60.0 / Hydrogen::get_instance()->getNewBpmJTM() * __rubberband.divider; |
| | 806 | double induration = (double) m_pslframes / (double) m_pSamplerate; |
| | 807 | if (induration != 0.0) m_pratio = durationtime / induration; |
| | 808 | |
| | 809 | //my personal ratio quality settings |
| | 810 | //ratios < 0.1 || > 3.0 are bad (red) or experimental sounds |
| | 811 | //ratios > 0.1 - 0.5 || > 2.0 are middle (yellow) |
| | 812 | //ratios < 0.5 || < 2.0 are good (green) |
| | 813 | |
| | 814 | bool is_green = false; |
| | 815 | //green ratio |
| | 816 | if( (m_pratio >= 0.5) && (m_pratio <= 2.0) ){ |
| | 817 | rubberComboBox->setStyleSheet("QComboBox { background-color: green; }"); |
| | 818 | is_green = true; |
| | 819 | } |
| | 820 | //yellow ratio |
| | 821 | if( ( (m_pratio > 0.1) || ( m_pratio <= 3.0 ) )&& (!is_green)){ |
| | 822 | rubberComboBox->setStyleSheet("QComboBox { background-color: yellow; }"); |
| | 823 | } |
| | 824 | //red ratio |
| | 825 | if( ( m_pratio <= 0.1 ) || ( m_pratio > 3.0 ) && (!is_green) ){ |
| | 826 | rubberComboBox->setStyleSheet("QComboBox { background-color: red; }"); |
| | 827 | } |
| | 828 | QString text = QString( " RB-Ratio = %1").arg(m_pratio); |
| | 829 | ratiolabel->setText( text ); |
| | 830 | |
| | 831 | //no rubberband = default |
| | 832 | if( !__rubberband.use ){ |
| | 833 | rubberComboBox->setStyleSheet("QComboBox { background-color: 58, 62, 72; }"); |
| | 834 | ratiolabel->setText( "" ); |
| | 835 | } |