Przeglądaj źródła

1.音叉和节拍器不同时播放。

Steven 10 miesięcy temu
rodzic
commit
7742083ba6

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Live/View/CreateLiveBodyView.m

@@ -34,7 +34,6 @@
     self.titleField.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请输入直播标题" attributes:@{NSForegroundColorAttributeName:HexRGB(0xc1c1c1)}];
     self.inputView.delegate = self;
     [self.buttonBgView drawBoardDottedLine:1.0f length:4 space:4 cornerRadius:10.0f lineColor:HexRGB(0xe3e3e3)];
-    
 }
 
 + (instancetype)shareInstance {
@@ -53,6 +52,7 @@
         self.chooseCoverBlock = callback;
     }
 }
+
 - (IBAction)chooseCover:(id)sender {
     if (self.chooseCoverBlock) {
         self.chooseCoverBlock();

+ 6 - 12
KulexiuForTeacher/KulexiuForTeacher/Module/Widget/Controller/ToneTuningViewController.m

@@ -17,10 +17,6 @@
 #import <KSTunerLibrary/KSTunerLibrary-Swift.h>
 #import "MetronomeManager.h"
 
-
-//  正确后暂停的时间
-static float correctTime = 0.5;
-
 @interface ToneTuningViewController ()<TunerDelegate>
 
 @property (nonatomic, strong) TuningNavView *navView;
@@ -59,13 +55,6 @@ static float correctTime = 0.5;
 // A4 频率
 @property (nonatomic, assign) NSInteger A4Frequence;
 
-/**
- 上次显示正确的时间
- */
-@property(nonatomic, assign) NSTimeInterval lastCorrectTime;
-
-
-
 @end
 
 @implementation ToneTuningViewController
@@ -318,6 +307,8 @@ static float correctTime = 0.5;
         case TUNINGACTION_PLAY:      // 播放音叉
         {
             [self startForkPlay];
+            // 停止播放节拍器
+            [self stopPlayBeat];
         }
             break;
         case TUNINGACTION_STOP:      // 停止音叉
@@ -328,6 +319,8 @@ static float correctTime = 0.5;
         case TUNINGACTION_BEATPLAY:
         {
             [self startPlayBeat];
+            // 停止音叉
+            [self stopForkPlay];
         }
             break;
         case TUNINGACTION_BEATSTOP:
@@ -419,7 +412,8 @@ static float correctTime = 0.5;
         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;