use of org.jivesoftware.sparkimpl.settings.local.LocalPreferences in project Spark by igniterealtime.
the class JmfMediaManager method getPreferredFormat.
/**
* reads the codec-order from the user-preferences
*
* @return
*/
// TODO REMOVE
@SuppressWarnings("unused")
private AudioFormat getPreferredFormat(ArrayList<String> formate) {
LocalPreferences localPreferences = SettingsManager.getLocalPreferences();
// gets the selected order from preferences
String[] codecs = localPreferences.getSelectedCodecs().split("\\^");
for (String codec : codecs) {
for (String format : formate) {
if (format != null && format.toLowerCase().equals(codec.toLowerCase()))
return new AudioFormat(format);
}
}
// this return shouldn't be executed, but if no codec was found, then use the first
return new AudioFormat(formate.get(0));
}
use of org.jivesoftware.sparkimpl.settings.local.LocalPreferences in project Spark by igniterealtime.
the class JmfMediaManager method getSelectedFormats.
private List<AudioFormat> getSelectedFormats() {
List<AudioFormat> format = new ArrayList<AudioFormat>();
List<AudioFormat> all = getAudioFormats();
LocalPreferences localPreferences = SettingsManager.getLocalPreferences();
// gets the selected order from preferences
String[] codecs = localPreferences.getSelectedCodecs().split("\\^");
for (AudioFormat form : all) {
for (String codec : codecs) {
if (form.getEncoding().toLowerCase().equals(codec.toLowerCase())) {
format.add(form);
}
}
}
System.out.println("FORMATE NEU: " + format);
return format;
}
use of org.jivesoftware.sparkimpl.settings.local.LocalPreferences in project Spark by igniterealtime.
the class MediaPreference method commit.
@Override
public void commit() {
LocalPreferences pref = SettingsManager.getLocalPreferences();
pref.setAudioSystem(panel.getAudioSystem());
pref.setAudioDevice(panel.getAudioDevice());
pref.setVideoDevice(panel.getVideoDevice());
pref.setStunFallbackHost(panel.getStunServer());
pref.setStunFallbackPort(panel.getStunPort());
pref.setPlaybackDevice(panel.getPlaybackDevice());
SettingsManager.saveSettings();
}
use of org.jivesoftware.sparkimpl.settings.local.LocalPreferences in project Spark by igniterealtime.
the class MediaPreference method load.
@Override
public void load() {
LocalPreferences localPreferences = SettingsManager.getLocalPreferences();
panel.setAudioSystem(localPreferences.getAudioSystem());
panel.setVideoDevice(localPreferences.getVideoDevice());
panel.setAudioDevice(localPreferences.getAudioDevice());
panel.setStunServer(localPreferences.getStunFallbackHost());
panel.setStunPort(localPreferences.getStunFallbackPort());
panel.setPlaybackDevice(localPreferences.getPlaybackDevice());
}
use of org.jivesoftware.sparkimpl.settings.local.LocalPreferences in project Spark by igniterealtime.
the class ChatManager method createConferenceRoom.
/**
* Creates a new public Conference Room.
*
* @param roomName the name of the room.
* @param serviceName the service name to use (ex.conference.jivesoftware.com)
* @return the new ChatRoom created. If an error occured, null will be returned.
*/
public ChatRoom createConferenceRoom(String roomName, String serviceName) {
final MultiUserChat chatRoom = MultiUserChatManager.getInstanceFor(SparkManager.getConnection()).getMultiUserChat(roomName + "@" + serviceName);
final GroupChatRoom room = UIComponentRegistry.createGroupChatRoom(chatRoom);
try {
LocalPreferences pref = SettingsManager.getLocalPreferences();
chatRoom.create(pref.getNickname());
// Send an empty room configuration form which indicates that we want
// an instant room
chatRoom.sendConfigurationForm(new Form(DataForm.Type.submit));
} catch (XMPPException | SmackException e1) {
Log.error("Unable to send conference room chat configuration form.", e1);
return null;
}
getChatContainer().addChatRoom(room);
return room;
}
Aggregations