SuperPlayerSoundEffectPitchView.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // SuperPlayerSoundEffectPitchView.m
  3. // BuguLive
  4. //
  5. // Created by 岳克奎 on 16/12/19.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import "SuperPlayerSoundEffectPitchView.h"
  9. @implementation SuperPlayerSoundEffectPitchView
  10. - (instancetype)initWithCoder:(NSCoder *)aDecoder
  11. {
  12. if (self = [super initWithCoder:aDecoder])
  13. {
  14. //因没实力化,子控件要在from nib 写
  15. }
  16. return self;
  17. }
  18. - (void)awakeFromNib
  19. {
  20. [super awakeFromNib];
  21. }
  22. #pragma mark - 音调调节
  23. - (IBAction)pitchValueChangeBtnClick:(UIButton *)sender
  24. {
  25. if(sender.tag == 0)
  26. {
  27. if ( self.pitchInt <12)
  28. {
  29. self.pitchInt = self.pitchInt +1;
  30. }
  31. }
  32. if(sender.tag == 1)
  33. {
  34. if (self.pitchInt>-12)
  35. {
  36. self.pitchInt = self.pitchInt -1;
  37. }
  38. }
  39. self.pitchValueShowLab.text = [NSString stringWithFormat:@"%ld",(long)self.pitchInt];
  40. if (self.delegate&&[self.delegate respondsToSelector:@selector(changeSoundEffectOfPitchValue:)])
  41. {
  42. [self.delegate changeSoundEffectOfPitchValue:self.pitchInt];
  43. }
  44. }
  45. - (void)setPitchInt:(NSInteger)pitchInt
  46. {
  47. _pitchInt = pitchInt;
  48. _pitchValueShowLab.text = [NSString stringWithFormat:@"%ld",(long)_pitchInt];
  49. //处理默认数据
  50. if (_delegate&&[_delegate respondsToSelector:@selector(changeSoundEffectOfPitchValue:)])
  51. {
  52. [_delegate changeSoundEffectOfPitchValue:_pitchInt];
  53. }
  54. }
  55. @end