From: liangzhenying <867174124@qq.com> Date: Tue, 20 Jan 2026 08:37:44 +0000 (+0800) Subject: 自定义eq适配 X-Git-Tag: mix-v1.0~1 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=ca9e052918b0aebfda5c74723a15104cf76376ca;p=mirrors%2FShenYin.git 自定义eq适配 --- diff --git a/ShenYin/Demo/AppDelegate.h b/ShenYin/Demo/AppDelegate.h new file mode 100644 index 0000000..2f4f3cd --- /dev/null +++ b/ShenYin/Demo/AppDelegate.h @@ -0,0 +1,14 @@ +// +// AppDelegate.h +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import + +@interface AppDelegate : UIResponder + + +@end + diff --git a/ShenYin/Demo/AppDelegate.m b/ShenYin/Demo/AppDelegate.m new file mode 100644 index 0000000..b1b5dcc --- /dev/null +++ b/ShenYin/Demo/AppDelegate.m @@ -0,0 +1,40 @@ +// +// AppDelegate.m +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +#pragma mark - UISceneSession lifecycle + + +- (UISceneConfiguration *)application:(UIApplication *)application configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" sessionRole:connectingSceneSession.role]; +} + + +- (void)application:(UIApplication *)application didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. + // Use this method to release any resources that were specific to the discarded scenes, as they will not return. +} + + +@end diff --git a/ShenYin/Demo/Assets.xcassets/AccentColor.colorset/Contents.json b/ShenYin/Demo/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ShenYin/Demo/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json b/ShenYin/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/ShenYin/Demo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/Demo/Assets.xcassets/Contents.json b/ShenYin/Demo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ShenYin/Demo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ShenYin/Demo/Base.lproj/LaunchScreen.storyboard b/ShenYin/Demo/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/ShenYin/Demo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ShenYin/Demo/Base.lproj/Main.storyboard b/ShenYin/Demo/Base.lproj/Main.storyboard new file mode 100644 index 0000000..808a21c --- /dev/null +++ b/ShenYin/Demo/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ShenYin/Demo/Info.plist b/ShenYin/Demo/Info.plist new file mode 100644 index 0000000..81ed29b --- /dev/null +++ b/ShenYin/Demo/Info.plist @@ -0,0 +1,25 @@ + + + + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + + diff --git a/ShenYin/Demo/SceneDelegate.h b/ShenYin/Demo/SceneDelegate.h new file mode 100644 index 0000000..7939f4a --- /dev/null +++ b/ShenYin/Demo/SceneDelegate.h @@ -0,0 +1,15 @@ +// +// SceneDelegate.h +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import + +@interface SceneDelegate : UIResponder + +@property (strong, nonatomic) UIWindow * window; + +@end + diff --git a/ShenYin/Demo/SceneDelegate.m b/ShenYin/Demo/SceneDelegate.m new file mode 100644 index 0000000..f6eb324 --- /dev/null +++ b/ShenYin/Demo/SceneDelegate.m @@ -0,0 +1,57 @@ +// +// SceneDelegate.m +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + + +- (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). +} + + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not necessarily discarded (see `application:didDiscardSceneSessions` instead). +} + + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. +} + + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. +} + + +@end diff --git a/ShenYin/Demo/ViewController.h b/ShenYin/Demo/ViewController.h new file mode 100644 index 0000000..c8f2f85 --- /dev/null +++ b/ShenYin/Demo/ViewController.h @@ -0,0 +1,14 @@ +// +// ViewController.h +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/ShenYin/Demo/ViewController.m b/ShenYin/Demo/ViewController.m new file mode 100644 index 0000000..401b9e2 --- /dev/null +++ b/ShenYin/Demo/ViewController.m @@ -0,0 +1,22 @@ +// +// ViewController.m +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + // Do any additional setup after loading the view. +} + + +@end diff --git a/ShenYin/Demo/main.m b/ShenYin/Demo/main.m new file mode 100644 index 0000000..954e6d1 --- /dev/null +++ b/ShenYin/Demo/main.m @@ -0,0 +1,18 @@ +// +// main.m +// Demo +// +// Created by liangshi on 2026/1/20. +// + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + NSString * appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/ShenYin/ShenYin.xcodeproj/project.pbxproj b/ShenYin/ShenYin.xcodeproj/project.pbxproj index bb0c0c4..f0060ed 100644 --- a/ShenYin/ShenYin.xcodeproj/project.pbxproj +++ b/ShenYin/ShenYin.xcodeproj/project.pbxproj @@ -217,6 +217,11 @@ path = ShenYin; sourceTree = ""; }; + 3FCCA1CF2F1F675F004C2A13 /* Demo */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = Demo; + sourceTree = ""; + }; /* End PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFrameworksBuildPhase section */ @@ -274,6 +279,7 @@ 3F887B9E2E38D8DC00C98658 /* ShenYin */, 3F8F68802EC1F25700FFC00B /* New Group */, 0D54E0F02F0A61E600A80EE7 /* DeepChordsSdk */, + 3FCCA1CF2F1F675F004C2A13 /* Demo */, 3F887B9D2E38D8DC00C98658 /* Products */, 34A14A83ECF09370871C891F /* Pods */, 676B86A4BA2639E8694D56B4 /* Frameworks */, @@ -727,10 +733,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(PROJECT_DIR)/ShenYin/UI/Mine/Update/SDKBleManager", - "$(PROJECT_DIR)/ShenYin/SDKBleManager", "$(PROJECT_DIR)/ShenYin/Ota", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus", "$(PROJECT_DIR)/DeepChordsSdk", "$(PROJECT_DIR)/ShenYin/Sdk/Ota", "$(PROJECT_DIR)/ShenYin/Sdk/JoySdk", @@ -756,10 +759,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus/code_opus/lib", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0.3; PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -789,10 +789,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(PROJECT_DIR)/ShenYin/UI/Mine/Update/SDKBleManager", - "$(PROJECT_DIR)/ShenYin/SDKBleManager", "$(PROJECT_DIR)/ShenYin/Ota", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus", "$(PROJECT_DIR)/DeepChordsSdk", "$(PROJECT_DIR)/ShenYin/Sdk/Ota", "$(PROJECT_DIR)/ShenYin/Sdk/JoySdk", @@ -818,10 +815,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus/code_opus/lib", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0.3; PRODUCT_BUNDLE_IDENTIFIER = com.deepchords.app; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -973,10 +967,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(PROJECT_DIR)/ShenYin/UI/Mine/Update/SDKBleManager", - "$(PROJECT_DIR)/ShenYin/SDKBleManager", "$(PROJECT_DIR)/ShenYin/Ota", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus", "$(PROJECT_DIR)/DeepChordsSdk", "$(PROJECT_DIR)/ShenYin/Sdk/Ota", "$(PROJECT_DIR)/ShenYin/Sdk/JoySdk", @@ -1001,10 +992,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus/code_opus/lib", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.ios.playboy; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1034,11 +1022,7 @@ FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)", - "$(PROJECT_DIR)/ShenYin/UI/Mine/Update/SDKBleManager", - "$(PROJECT_DIR)/ShenYin/SDKBleManager", "$(PROJECT_DIR)/ShenYin/Ota", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus", - "$(PROJECT_DIR)/DeepChordsSdk", "$(PROJECT_DIR)/ShenYin/Sdk/Ota", "$(PROJECT_DIR)/ShenYin/Sdk/JoySdk", "$(PROJECT_DIR)/ShenYin/Sdk/JoySdk/tool", @@ -1062,10 +1046,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/ShenYin/Sdk/DcSdk/opus/code_opus/lib", - ); + LIBRARY_SEARCH_PATHS = "$(inherited)"; MARKETING_VERSION = 1.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.ios.playboy; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/ShenYin/ShenYin/UI/Mode/CustomEqVC.swift b/ShenYin/ShenYin/UI/Mode/CustomEqVC.swift index 6848f05..06533a6 100644 --- a/ShenYin/ShenYin/UI/Mode/CustomEqVC.swift +++ b/ShenYin/ShenYin/UI/Mode/CustomEqVC.swift @@ -30,7 +30,7 @@ class CustomEqVC:BaseVC{ bgView.do { v in v.backgroundColor = CCDevice.isJoy ? UIColor.white:UIColor.rgb(0x242424) - v.yc.setCornerRadius(12) + v.yc.setCornerRadius(12.fitR) } sliderBgView.do { v in // v.backgroundColor = .yellow @@ -75,47 +75,47 @@ class CustomEqVC:BaseVC{ override func setupLayout() { bgView.snp.makeConstraints { make in - make.width.equalTo(kScreenWid - 36) - make.height.equalTo(330) + make.width.equalTo(kScreenWid - 36.fitR) + make.height.equalTo(330.fitR) make.centerX.equalToSuperview() - make.top.equalToSuperview().inset(kNavBtm + 30) + make.top.equalToSuperview().inset(kNavBtm + 30.fitR) } resetBtn.snp.makeConstraints { make in make.top.equalToSuperview() make.right.equalToSuperview() - make.size.equalTo(40) + make.size.equalTo(40.fitR) } titleLabel.snp.makeConstraints { make in - make.top.equalToSuperview().inset(12) - make.left.equalToSuperview().inset(12) + make.top.equalToSuperview().inset(12.fitR) + make.left.equalToSuperview().inset(12.fitR) } unitLabel.snp.makeConstraints { make in - make.top.equalToSuperview().inset(55) - make.left.equalToSuperview().inset(12) + make.top.equalToSuperview().inset(45.fitR) + make.left.equalToSuperview().inset(12.fitR) } valueLabel1.snp.makeConstraints { make in - make.top.equalToSuperview().inset(80) - make.left.equalToSuperview().inset(10) + make.top.equalToSuperview().inset(75.fitR) + make.left.equalToSuperview().inset(10.fitR) } valueLabel2.snp.makeConstraints { make in - make.top.equalToSuperview().inset(190) + make.top.equalToSuperview().inset(180.fitR) make.left.equalTo(valueLabel1) } valueLabel3.snp.makeConstraints { make in - make.top.equalToSuperview().inset(Int(kScreenWid) - 36 - 45) + make.top.equalToSuperview().inset(kScreenWid - 36.fitR - 40.fitR) make.left.equalTo(valueLabel1) } sliderBgView.snp.makeConstraints { make in make.left.equalToSuperview().inset(0) - make.right.equalToSuperview().inset(10) + make.right.equalToSuperview().inset(10.fitR) make.top.equalToSuperview().inset(0) make.bottom.equalToSuperview().inset(0) } let values = ["32","64","125","250","500","1k","2k","4k","8k","16k"] - let start = 30 - let w = (Int(kScreenWid) - 36 - start - 10)/10 - let h = (Int(kScreenWid) - 36 - start - 10)/10 + let start = 30.fitR + let w = (kScreenWid - 36.fitR - start - 10)/10 + let h = (kScreenWid - 36.fitR - start - 10)/10 for i in 0...9 { let slider = EqSlider() slider.index = i @@ -128,7 +128,7 @@ class CustomEqVC:BaseVC{ slider.snp.makeConstraints { make in make.width.equalTo(h*10) make.height.equalTo(h) - make.top.equalTo(i*w + start) + make.top.equalTo(CGFloat(i)*w + start) make.left.equalToSuperview() } } @@ -200,22 +200,22 @@ private class EqSlider: BaseView { } override func setupLayout() { - let h = 25 + let h = 25.fitR titleLabel.snp.makeConstraints { make in make.centerY.equalToSuperview() - make.left.equalToSuperview().inset(10) + make.left.equalToSuperview().inset(10.fitR) make.width.equalTo( h) } valueLabel.snp.makeConstraints { make in make.centerY.equalToSuperview() - make.right.equalToSuperview().inset(10) + make.right.equalToSuperview().inset(10.fitR) make.width.equalTo( h) } slider.snp.makeConstraints { make in make.height.equalTo( h) make.centerY.equalToSuperview() - make.right.equalToSuperview().inset(40) - make.left.equalToSuperview().inset(40) + make.right.equalToSuperview().inset(40.fitR) + make.left.equalToSuperview().inset(40.fitR) } } @objc func sliderChanged(_ slider:UISlider){