|
@@ -251,13 +251,22 @@ class MovieEditActivity : AppCompatActivity(), DialogInterface.OnDismissListener
|
|
val inputSceneStatus = LinkedHashMap<Int, Int>()
|
|
val inputSceneStatus = LinkedHashMap<Int, Int>()
|
|
var sceneIndex = -1
|
|
var sceneIndex = -1
|
|
var sceneRepeatCount = 0
|
|
var sceneRepeatCount = 0
|
|
|
|
+ var sceneCount = 0
|
|
|
|
+
|
|
|
|
|
|
val movieBuilder = MovieMaker.Builder(mediaHelper)
|
|
val movieBuilder = MovieMaker.Builder(mediaHelper)
|
|
movieBuilder.fps = FPS
|
|
movieBuilder.fps = FPS
|
|
movieBuilder.audioSources = generateAudioSource()
|
|
movieBuilder.audioSources = generateAudioSource()
|
|
|
|
+
|
|
|
|
+ var totalFrame = 0
|
|
|
|
+ scene?.record?.period?.let {
|
|
|
|
+ totalFrame = (it/((1f / FPS) * 1000).toLong()).toInt()
|
|
|
|
+ }
|
|
|
|
+
|
|
generateMovieFilms()
|
|
generateMovieFilms()
|
|
.subscribeOn(Schedulers.io())
|
|
.subscribeOn(Schedulers.io())
|
|
.subscribe({
|
|
.subscribe({
|
|
|
|
+ Log.d("Debug","progress ${sceneCount++}/$totalFrame")
|
|
if (it.key == sceneIndex) {
|
|
if (it.key == sceneIndex) {
|
|
sceneRepeatCount++
|
|
sceneRepeatCount++
|
|
} else {
|
|
} else {
|
|
@@ -298,34 +307,22 @@ class MovieEditActivity : AppCompatActivity(), DialogInterface.OnDismissListener
|
|
scene?.apply {
|
|
scene?.apply {
|
|
record?.apply {
|
|
record?.apply {
|
|
var bitmap = drawScene(0)
|
|
var bitmap = drawScene(0)
|
|
|
|
+ var bitmapIndex = 0
|
|
var trackPosition = -1
|
|
var trackPosition = -1
|
|
- var isDrawNewScene: Boolean
|
|
|
|
-
|
|
|
|
- for (t in 0..period step ((1f / FPS.toFloat()) * 1000).toLong()) {
|
|
|
|
- isDrawNewScene = false
|
|
|
|
|
|
|
|
|
|
+ for (t in 0 .. period step ((1f / FPS) * 1000).toLong()) {
|
|
for (track in tracks) {
|
|
for (track in tracks) {
|
|
if (t >= track.time && tracks.indexOf(track) > trackPosition) {
|
|
if (t >= track.time && tracks.indexOf(track) > trackPosition) {
|
|
- isDrawNewScene = true
|
|
|
|
-
|
|
|
|
preBitmap = bitmap
|
|
preBitmap = bitmap
|
|
preBitmap?.recycle()
|
|
preBitmap?.recycle()
|
|
|
|
|
|
bitmap = drawScene(track.positionX)
|
|
bitmap = drawScene(track.positionX)
|
|
trackPosition = tracks.indexOf(track)
|
|
trackPosition = tracks.indexOf(track)
|
|
-
|
|
|
|
- bitmap?.apply {
|
|
|
|
- it.onNext(AbstractMap.SimpleEntry(trackPosition + 1, this))
|
|
|
|
- Log.d("Debug", "Index: ${trackPosition + 1} Time: $t")
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
bitmap?.apply {
|
|
bitmap?.apply {
|
|
- if (!isDrawNewScene) {
|
|
|
|
- it.onNext(AbstractMap.SimpleEntry(trackPosition + 1, this))
|
|
|
|
- Log.d("Debug", "Index: ${trackPosition + 1} Time: $t")
|
|
|
|
- }
|
|
|
|
|
|
+ it.onNext(AbstractMap.SimpleEntry(bitmapIndex++, this))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
it.onComplete()
|
|
it.onComplete()
|