e-mon / andante Goto Github PK
View Code? Open in Web Editor NEWSADP Application
SADP Application
バックグラウンドでのRec/Playが上手くいかない場合がある。
今のところRec/Playどちらの問題なのかわからないためまず原因を特定する必要がある。
ポーズ状態で録音機能を使用した際に曲が登録される問題の修正を行います.
'Andante/BackgroundRecController.swift'
ついでに,曲があまりに近い場合にも登録しないようにしたほうがいいのかな?と思うんですけど,どうしましょう.
ViewController.swiftのリファクタリング
CLRegion
-> CLCircularRegion
への変更再生範囲を見える化する機能の実装
Andante/ViewController.swift
#30 で列挙したうち、Lv.1 と Lv. 2 に該当する修正
最低限の実装がもうすぐできそうなので、そろそろコードを整理していった方が良さそう。
参考: http://qiita.com/susieyy/items/f71435cc962e70d81b37
修正の難易度に応じて5つのレベルに分けてみた。
基本機能ができればバージョン番号を付与したほうが良さそう?
git tag
やXcodeの機能で何ができるか調べる。
CLRegion
オブジェクトとそれに付帯するSong,Artist文字列などを永続化するためにCoreDataにて実装する。
参照:http://d.hatena.ne.jp/glass-_-onion/20111015/1318667971
PlayRoute(Region : CLRegion, ArtistName : String, SongName : String, UserName : String, timestamp: Date)
今後Publicなデータを用いることを考えて、usernameをつけることにした。
PlayRouteManager
CoreDataを介してget,setなどを行う管理クラス
PrayRoute Class : MSManagedObject
MSManagedObject
を継承したEntityの実装クラス
let prm = PlayRouteManager()
let clc1 = CLLocationCoordinate2D(latitude: 10, longitude: 10)
let clc2 = CLLocationCoordinate2D(latitude: 150, longitude: 150)
let region1 : CLRegion = CLCircularRegion(center: clc1, radius: 20.0, identifier: "test1")
let region2 : CLRegion = CLCircularRegion(center: clc2, radius: 20.0, identifier: "test1")
prm.setRegion(region1, songName: "testSong1", artistName: "artist1", userName: "user1")
prm.setRegion(region2, songName: "testSong2", artistName: "artist2", userName: "user2")
for pr in prm{
println(pr.songName) // -> testSong2
}
今現在は必要最小限と思われる regin
からのsong,artist取得と、各種データのset関数しか用意していないです。メソッド名や任意のfetchが行いたい等の場合はまた別のissueで行います。
systemMusicPlayerがStopする
原因は判ってるのですぐ直します
emon氏のお告げをもとにSphereMenuを実装した
http://code4app.net/ios/SphereMenuSwift/5465a1ade247412a2628bb71
Andante/ViewController.swift
Andante/PlayRouteManager.swift
標記の通りです.現在仕様だと,CoreDataに追加されたタイミングでの表示が行えないので
修正が必要になります.以下のその方法を個人的に検討した結果を書いておきます.
Background Rec Controller
にVCからデリゲートさせるようにして対応チュートリアルが欲しい。
よくあるスワイプで読み進めるペラ説明書。
Play モードの挙動を担うクラス。
下記のBGPlayControllerにあたる。
https://files.slack.com/files-pri/T02MLD2G1-F02R0JZ8S/slack_for_ios_upload.jpg
大文字プレフィクスはフレームワークを示すという通則があるみたいなので、名前を変えた。
https://developer.apple.com/jp/devcenter/ios/library/documentation/CodingGuidelines.pdf
AndanteWidget/BackgroundPlayController.swift
Andante/BackgroundPlayController.swift
(バックグラウンド処理をAndante本体に任せるため変更)
https://files.slack.com/files-pri/T02MLD2G1-F02R0JVK6/slack_for_ios_upload.jpg
ViewController
が担うViewController
は BackgroundPlayController
のインスタンスを持つViewController
が BackgroundPlayController
を有効化するメソッドを呼ぶstartMonitoringForRegion()
するlocationManager(_:didEnterRegion:)
でRegionに入ったことを検知したら、Regionに対応付けられている曲を取得して systemMusicPlayer
にキュー出しissue #7 で修正したgetMediaItem
method のオーバーロードメソッドを追加し,パラメータによって
範囲クエリを扱えるように修正します.
getMediaItem(center : CLLocationCoodinate2D) -> MediaItem?
AndanteWidgetでモードが切り替えられるごとに、BackgroundPlayControllerやBackgroundRecControllerをON/OFFする
担当: wsaito
担当: yubessy
担当: xynophon
Play モードの挙動を担うクラス。
当初 #1 の通りregion monitoringを使用して実装するつもりだったが、期待すべき仕様
をみたさないのでlocation updatingで作りなおす。
Andante/BackgroundPlayController.swift
ViewController
が担うViewController
は BackgroundPlayController
のインスタンスを持つViewController
が BackgroundPlayController
を有効化するメソッドを呼ぶlocationManager.startUpdatingLocation()
するlocationManager(_:didUpdateLocations:)
が発火し、かつ次の全ての条件を満たした場合、対応する曲を systemMusicPlayer
にキュー出し
Implement function that let TodayViewController in AndanteWidget control BackgroundRecController in Andante main app.
Let BackgroundRecController save song and location information when AndanteWidget in TodayViewController is selected 'Rec' using NSUserDefaults.
ViewController.swift
内のfunc mapView(mapView: MKMapView!, viewForAnnotation annotation: MKAnnotation!)
で修正。
また、Toucan.swift
ファイルを追加。
ユーザーの現在位置表示が楽曲アノテーションに隠れてしまうのを修正.
バグというよりは機能向上かな,と思うので,enhancementに設定しました.
Andante/ViewController.swift
ツールバー表示よりMap上にボタン表示のほうがベネ.
getMediaPlayItem
の引数に検索範囲四角形の1辺の長さを引数に持つように変更Andante/PlayRouteManager.swift
Andante/ViewController.swift
func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool)
の中で実装。
BackgroundRecController.swiftをAndanteに移動。
BackgroundRecController.swift
位置情報と再生中の音楽情報を取って音楽が変更されていればDBに保存。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.