Browse Source

选择节拍重置节奏

Steven 11 months ago
parent
commit
520b1c7577

+ 1 - 1
KulexiuForStudent/KulexiuForStudent.xcodeproj/xcshareddata/xcschemes/KulexiuForStudent.xcscheme

@@ -92,7 +92,7 @@
       buildConfiguration = "Debug">
    </AnalyzeAction>
    <ArchiveAction
-      buildConfiguration = "Release"
+      buildConfiguration = "TEST"
       revealArchiveInOrganizer = "YES">
    </ArchiveAction>
 </Scheme>

+ 3 - 2
KulexiuForStudent/KulexiuForStudent/Module/Widget/Controller/ToneTuningViewController.m

@@ -293,6 +293,8 @@
         case TUNINGACTION_FORKSETTING:  // 音叉设置
         {
             [self.forkView showView];
+            // 停止播放节拍器
+            [self stopPlayBeat];
         }
             break;
         case TUNINGACTION_FREQUENCE: // 调整频率
@@ -390,6 +392,7 @@
 - (void)beatChoose {
     [METRONOME_MANAGER beatChooseCallback:^(KSWidgeMetronomeType type) {
         [self disPlayBeat];
+        [self changeRhythm];
     }];
 }
 
@@ -415,8 +418,6 @@
         MJWeakSelf;
         [_forkView forkSettingAction:^(CGFloat frequence, BOOL isSure) {
             NSLog(@"----- frequence %f", frequence);
-            // 停止播放节拍器
-            [weakSelf stopPlayBeat];
             weakSelf.chooseFrequence = frequence;
             if (weakSelf.bodyView.isPlaying) {
                 CGFloat changefrequence = frequence / A4_FREQUENCE_INTABLE * self.A4Frequence;

+ 2 - 8
KulexiuForStudent/KulexiuForStudent/Module/Widget/Controller/WidgetViewController.m

@@ -83,20 +83,13 @@
         make.left.right.top.mas_equalTo(self.view);
         make.height.mas_equalTo(kNaviBarHeight);
     }];
-    
-//    [self.view addSubview:self.dotView];
-//    [self.dotView mas_makeConstraints:^(MASConstraintMaker *make) {
-//        make.left.right.mas_equalTo(self.view);
-//        make.top.mas_equalTo(self.navView.mas_bottom).offset(10);
-//        make.height.mas_equalTo(44);
-//    }];
+
     CGFloat topSpace = IS_IPAD ? 100 + 44 : 10 + 44;
 
     CGFloat speedViewHeight = [WidgetSpeedView getViewHeight];
     [self.view addSubview:self.speedView];
     [self.speedView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.right.mas_equalTo(self.view);
-//        make.top.mas_equalTo(self.dotView.mas_bottom);
         make.top.mas_equalTo(self.navView.mas_bottom).offset(topSpace);
         make.height.mas_equalTo(speedViewHeight);
     }];
@@ -129,6 +122,7 @@
         self.beatNumber = beatNumber;
         [self changeBeat];
         self.functionView.beatLabel.text = [NSString stringWithFormat:@"%zd",beatNumber];
+        [self changeRhythmDisplay];
     }];
 }
 

+ 4 - 0
KulexiuForStudent/KulexiuForStudent/Module/Widget/Model/MetronomeManager.m

@@ -184,6 +184,7 @@
         NSInteger beatNumber = [returnValue integerValue];
         self.beatNumber = beatNumber;
         [self changeBeat];
+        [self resetRyhthm];
         if (callback) {
             callback(beatNumber);
         }
@@ -193,6 +194,9 @@
     [pickerView showPicker];
 }
 
+- (void)resetRyhthm {
+    self.rhythmType = RHYTHM_TYPE_ONE_QUARTERNOTES;
+}
 
 - (void)rhythmChooseCallback:(RhythmChangeCallback)callback {
     RhythmChooseView *chooseView = [RhythmChooseView shareInstance];