Steven пре 11 месеци
родитељ
комит
a3bfe23d2e

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

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

+ 4 - 2
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Controller/ToneTuningViewController.m

@@ -290,6 +290,8 @@
         case TUNINGACTION_FORKSETTING:  // 音叉设置
         {
             [self.forkView showView];
+            // 停止播放节拍器
+            [self stopPlayBeat];
         }
             break;
         case TUNINGACTION_FREQUENCE: // 调整频率
@@ -387,6 +389,7 @@
 - (void)beatChoose {
     [METRONOME_MANAGER beatChooseCallback:^(KSWidgeMetronomeType type) {
         [self disPlayBeat];
+        [self changeRhythm];
     }];
 }
 
@@ -412,8 +415,7 @@
         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;

+ 7 - 6
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Controller/WidgetViewController.m

@@ -44,11 +44,6 @@
     [self configUI];
 }
 
-- (void)viewWillAppear:(BOOL)animated {
-    [super viewWillAppear:animated];
-    [self setDefaultConfig];
-}
-
 - (void)backAction {
     [self.navigationController popViewControllerAnimated:YES];
 }
@@ -65,6 +60,10 @@
     [self changeRhythmDisplay];
 }
 
+- (void)viewWillAppear:(BOOL)animated {
+    [super viewWillAppear:animated];
+    [self setDefaultConfig];
+}
 
 - (void)configUI {
     [self.scrollView removeFromSuperview];
@@ -87,7 +86,7 @@
 //    [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.top.mas_equalTo(self.navView.mas_bottom).offset(topSpace);
 //        make.height.mas_equalTo(44);
 //    }];
     CGFloat topSpace = IS_IPAD ? 100 + 44 : 10 + 44;
@@ -129,6 +128,7 @@
         self.beatNumber = beatNumber;
         [self changeBeat];
         self.functionView.beatLabel.text = [NSString stringWithFormat:@"%zd",beatNumber];
+        [self changeRhythmDisplay];
     }];
 }
 
@@ -234,6 +234,7 @@
 - (void)changeRhythm {
     self.functionView.rhythmType = self.rhythmType;
 }
+
 - (void)setSpeed:(int)speed {
     _speed = speed;
     [self stopBeat];

+ 5 - 0
KulexiuForTeacher/KulexiuForTeacher/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];
@@ -219,6 +223,7 @@
     NSArray *array = @[@"rhythm_quarterNote",@"rhythm_two_eighthNote",@"rhythm_quarter_riplet",@"rhythm_four_sixteenthNote",@"rhythm_quarter_and_eighth_riplet",@"rhythm_dottedEighth_and_sixteenthNote",@"rhythm_eighth_and_two_sixteenthNote"];
     return array[index];
 }
+
 - (void)resetDefaultConfig {
     [self configDefault];
 }