Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Laurent Besacier
lig-aikuma
Commits
9c204d73
Commit
9c204d73
authored
Jun 30, 2016
by
Elodie Gauthier
Browse files
upgrade version and fix bug on RecordElicitation
parent
949a2289
Changes
5
Hide whitespace changes
Inline
Side-by-side
Aikuma/AndroidManifest.xml
View file @
9c204d73
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"org.lp20.aikuma2"
android:versionCode=
"01000
5
"
android:versionName=
"
0.8.4
"
>
android:versionCode=
"01
1
000"
android:versionName=
"
1.0
"
>
<uses-sdk
android:minSdkVersion=
"14"
/>
<uses-permission
android:name=
"android.permission.RECORD_AUDIO"
/>
<uses-permission
android:name=
"android.permission.ACCESS_WIFI_STATE"
/>
...
...
Aikuma/src/org/lp20/aikuma/ui/ElicitationMode.java
View file @
9c204d73
...
...
@@ -171,12 +171,12 @@ public class ElicitationMode extends AikumaActivity{
mPath
=
new
File
(
mPath
,
mChosenFile
);
if
(
mPath
.
isDirectory
())
{
if
(!
isSelectionnable
(
mPath
))
{
Log
.
d
(
"not selectionnable"
,
"not selectionnable"
);
Log
.
d
(
TAG
,
"not selectionnable"
);
loadFileList
(
mPath
,
fileType
);
if
(
mFileList
.
length
>
0
)
showAudioFilebrowserDialog
();
}
else
{
Log
.
d
(
"mPath"
,
mPath
.
getAbsolutePath
()
+
" is selectionnable"
);
Log
.
d
(
TAG
,
mPath
.
getAbsolutePath
()
+
" is selectionnable"
);
actionSelectedFile
();
}
}
else
if
(
mPath
.
isFile
()
&&
mPath
.
toString
().
contains
(
".txt"
))
{
...
...
Aikuma/src/org/lp20/aikuma/ui/ListFileAdapter.java
View file @
9c204d73
...
...
@@ -19,6 +19,7 @@ import android.widget.TextView;
public
class
ListFileAdapter
extends
ArrayAdapter
{
private
LayoutInflater
layoutInflater
;
private
File
parentFile
;
public
static
final
String
TAG
=
"ListFileAdapter"
;
static
class
ViewHolder
{
public
TextView
textFileName
;
...
...
@@ -56,7 +57,7 @@ public class ListFileAdapter extends ArrayAdapter {
RelativeLayout
relativeListFile
=
(
RelativeLayout
)
rowView
.
findViewById
(
R
.
id
.
layoutListView
);
if
(!
file
.
isDirectory
())
{
Log
.
d
(
"fileName : "
,
"fileName : "
+
file
.
getAbsolutePath
());
Log
.
d
(
TAG
,
"fileName : "
+
file
.
getAbsolutePath
());
if
(
fileName
.
contains
(
"rspk"
)
&&
fileName
.
contains
(
".wav"
))
{
relativeListFile
.
setBackgroundColor
(
Color
.
parseColor
(
"#80673AB7"
));
}
...
...
Aikuma/src/org/lp20/aikuma/ui/RecordElicitation.java
View file @
9c204d73
...
...
@@ -163,8 +163,9 @@ public class RecordElicitation extends AikumaActivity {
}
private
void
loadVideo
()
{
Log
.
d
(
TAG
,
"entityId = "
+
entityId
+
"; numberOfEntities = "
+
numberOfEntities
);
if
(
entityId
>=
numberOfEntities
)
{
Toast
.
makeText
(
this
,
"No more
image
s to display"
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
this
,
"No more
video
s to display"
,
Toast
.
LENGTH_LONG
).
show
();
if
((
choiceMode
==
ElicitationMode
.
IMAGE_MODE
||
choiceMode
==
ElicitationMode
.
VIDEO_MODE
)
&&
bufferedWriter
!=
null
)
{
try
{
bufferedWriter
.
close
();
...
...
@@ -186,6 +187,8 @@ public class RecordElicitation extends AikumaActivity {
videoView
.
setBackgroundDrawable
(
bitmapDrawable
);
videoView
.
setVisibility
(
View
.
GONE
);
videoView
.
setVisibility
(
View
.
VISIBLE
);
TextView
tv_numVideo
=
(
TextView
)
findViewById
(
R
.
id
.
image_x
);
tv_numVideo
.
setText
(
"Video"
+
entityId
);
}
}
...
...
@@ -217,6 +220,7 @@ public class RecordElicitation extends AikumaActivity {
}
private
void
loadImage
()
{
Log
.
d
(
TAG
,
"entityId = "
+
entityId
+
"; numberOfEntities = "
+
numberOfEntities
);
if
(
entityId
>=
numberOfEntities
){
Toast
.
makeText
(
this
,
"No more images to display"
,
Toast
.
LENGTH_LONG
).
show
();
if
((
choiceMode
==
ElicitationMode
.
IMAGE_MODE
||
choiceMode
==
ElicitationMode
.
VIDEO_MODE
)
&&
bufferedWriter
!=
null
)
{
...
...
@@ -233,6 +237,8 @@ public class RecordElicitation extends AikumaActivity {
options
.
inPreferredConfig
=
Bitmap
.
Config
.
ARGB_8888
;
BitmapWorkerTask
task
=
new
BitmapWorkerTask
(
selected_photo
);
task
.
execute
(
images
[
entityId
]);
TextView
tv_numImage
=
(
TextView
)
findViewById
(
R
.
id
.
image_x
);
tv_numImage
.
setText
(
"Image"
+
entityId
);
}
}
...
...
@@ -375,7 +381,7 @@ public class RecordElicitation extends AikumaActivity {
/**
* called when we want to save one record. Used when we touch ne
w
t button
* called when we want to save one record. Used when we touch ne
x
t button
*/
private
void
saveOneRecord
()
{
recordUUID
=
UUID
.
randomUUID
();
...
...
@@ -427,8 +433,8 @@ public class RecordElicitation extends AikumaActivity {
"Error setting up microphone."
,
Toast
.
LENGTH_LONG
).
show
();
}
catch
(
IOException
e
)
{
Toast
.
makeText
(
this
,
"No more
sentences
to display"
,
Toast
.
LENGTH_LONG
).
show
();
Log
.
e
(
TAG
,
"No more
sentences
to display or an error occurred: "
+
e
);
Toast
.
makeText
(
this
,
"No more to display"
,
Toast
.
LENGTH_LONG
).
show
();
Log
.
e
(
TAG
,
"No more to display or an error occurred: "
+
e
);
this
.
finish
();
}
}
...
...
@@ -476,8 +482,10 @@ public class RecordElicitation extends AikumaActivity {
* @param _view the next button
*/
public
void
onNextClick
(
View
_view
)
{
if
(!
saveRecording
())
Toast
.
makeText
(
this
,
"Going to next sentence..."
,
Toast
.
LENGTH_LONG
).
show
();
if
(!
saveRecording
()
&&
(
entityId
+
1
<
numberOfEntities
))
{
Log
.
d
(
TAG
,
"onNextClick => entityId = "
+
entityId
+
"; numberOfEntities = "
+
numberOfEntities
);
Toast
.
makeText
(
this
,
"Going next..."
,
Toast
.
LENGTH_SHORT
).
show
();
}
saveOneRecord
();
}
...
...
@@ -509,7 +517,7 @@ public class RecordElicitation extends AikumaActivity {
this
.
strFolderDate
+
"_"
+
recordLang
.
getCode
()
+
"_"
+
Aikuma
.
getDeviceId
()
+
"_"
+
i
+
RecordingLig
.
METADATA_SUFFIX
);
i
--;
}
while
(!
metadataFile
.
exists
());
Log
.
d
(
"metadataFile : "
,
"metadataFile : "
+
metadataFile
.
getAbsolutePath
());
Log
.
d
(
TAG
,
"metadataFile : "
+
metadataFile
.
getAbsolutePath
());
try
{
recordingLig
=
RecordingLig
.
read
(
metadataFile
);
int
duration
=
recorder
.
getCurrentMsec
();
...
...
@@ -574,13 +582,13 @@ public class RecordElicitation extends AikumaActivity {
*/
private
boolean
saveRecording
()
{
if
((
recorder
!=
null
&&
recorder
.
getFile
().
getPayloadSize
()
==
0
)
||
recorder
==
null
)
{
return
false
;
return
false
;
}
try
{
recorder
.
stop
();
}
catch
(
MicException
e
)
{
Log
.
e
(
TAG
,
"error when saving the rec
r
oding: "
+
e
);
Log
.
e
(
TAG
,
"error when saving the reco
r
ding: "
+
e
);
Toast
.
makeText
(
this
,
"An error occurred when saving the recording. Please try again."
,
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
...
...
@@ -606,7 +614,7 @@ public class RecordElicitation extends AikumaActivity {
bufferedWriter
.
flush
();
}
}
catch
(
IOException
e
)
{
Log
.
e
(
TAG
,
"error when saving the rec
r
oding: "
+
e
);
Log
.
e
(
TAG
,
"error when saving the reco
r
ding: "
+
e
);
Toast
.
makeText
(
this
,
"An error occurred when saving the recording. Please try again."
,
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
...
...
@@ -745,13 +753,14 @@ public class RecordElicitation extends AikumaActivity {
}
private
void
interruptionCallback
()
{
String
message
=
"
a
session is in progress. Do you want save the progression?"
;
String
message
=
"
A
session is in progress. Do you want
to
save the progression?"
;
if
(
safeActivityTransitionMessage
!=
null
)
{
message
=
safeActivityTransitionMessage
;
}
if
(
entityId
==
0
)
if
(
entityId
==
0
)
{
this
.
finish
();
}
new
AlertDialog
.
Builder
(
this
)
.
setMessage
(
message
)
...
...
Aikuma/src/org/lp20/aikuma/ui/RespeakingSelection.java
View file @
9c204d73
...
...
@@ -161,7 +161,7 @@ public class RespeakingSelection extends AikumaActivity {
}
/**
* called by the the FileBrowserFragment when the selected item is not a d
o
rectory.
* called by the the FileBrowserFragment when the selected item is not a d
i
rectory.
*/
private
void
fileIsNotADirectory
()
{
SharedPreferences
preferences
=
PreferenceManager
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment