All Downloads are FREE. Search and download functionalities are using the official Maven repository.

system.media.SoundPlayer Maven / Gradle / Ivy

/*
 *  MIT License
 *
 *  Copyright (c) 2024 MASES s.r.l.
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in all
 *  copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 *  SOFTWARE.
 */

/**************************************************************************************
 * 
 *      This code was generated from a template using JCOReflector v. 1.15.0.0
 * 
 *      Manual changes to this file may cause unexpected behavior in your application.
 *      Manual changes to this file will be overwritten if the code is regenerated.
 * 
 *************************************************************************************/

package system.media;

import org.mases.jcobridge.*;
import org.mases.jcobridge.netreflection.*;
import java.util.ArrayList;

// Import section
import system.componentmodel.Component;
import system.io.Stream;
import system.runtime.serialization.SerializationInfo;
import system.runtime.serialization.StreamingContext;
import system.componentmodel.AsyncCompletedEventHandler;
import system.EventHandler;
import system.runtime.serialization.ISerializable;
import system.runtime.serialization.ISerializableImplementation;


/**
 * The base .NET class managing System.Media.SoundPlayer, System.Windows.Extensions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51.
 * 

* * .NET documentation at https://docs.microsoft.com/en-us/dotnet/api/System.Media.SoundPlayer *

* * Powered by JCOBridge: more info at https://www.jcobridge.com * * @author MASES s.r.l https://masesgroup.com * @version 1.15.0.0 */ public class SoundPlayer extends Component implements system.runtime.serialization.ISerializable { /** * Fully assembly qualified name: System.Windows.Extensions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 */ public static final String assemblyFullName = "System.Windows.Extensions, Version=9.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"; /** * Assembly name: System.Windows.Extensions */ public static final String assemblyShortName = "System.Windows.Extensions"; /** * Qualified class name: System.Media.SoundPlayer */ public static final String className = "System.Media.SoundPlayer"; static JCOBridge bridge = JCOBridgeInstance.getInstance(assemblyFullName); /** * The type managed from JCOBridge. See {@link JCType} */ public static JCType classType = createType(); static JCEnum enumInstance = null; JCObject classInstance = null; static JCType createType() { try { String classToCreate = className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); if (JCOReflector.getDebug()) JCOReflector.writeLog("Creating %s", classToCreate); JCType typeCreated = bridge.GetType(classToCreate); if (JCOReflector.getDebug()) JCOReflector.writeLog("Created: %s", (typeCreated != null) ? typeCreated.toString() : "Returned null value"); return typeCreated; } catch (JCException e) { JCOReflector.writeLog(e); return null; } } void addReference(String ref) throws Throwable { try { bridge.AddReference(ref); } catch (JCNativeException jcne) { throw translateException(jcne); } } /** * Internal constructor. Use with caution */ public SoundPlayer(java.lang.Object instance) throws Throwable { super(instance); if (instance instanceof JCObject) { classInstance = (JCObject) instance; } else throw new Exception("Cannot manage object, it is not a JCObject"); } public String getJCOAssemblyName() { return assemblyFullName; } public String getJCOClassName() { return className; } public String getJCOObjectName() { return className + ", " + (JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); } public java.lang.Object getJCOInstance() { return classInstance; } public void setJCOInstance(JCObject instance) { classInstance = instance; super.setJCOInstance(classInstance); } public JCType getJCOType() { return classType; } /** * Try to cast the {@link IJCOBridgeReflected} instance into {@link SoundPlayer}, a cast assert is made to check if types are compatible. * @param from {@link IJCOBridgeReflected} instance to be casted * @return {@link SoundPlayer} instance * @throws java.lang.Throwable in case of error during cast operation */ public static SoundPlayer cast(IJCOBridgeReflected from) throws Throwable { NetType.AssertCast(classType, from); return new SoundPlayer(from.getJCOInstance()); } // Constructors section public SoundPlayer() throws Throwable, system.ArgumentException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.NotSupportedException, system.ObjectDisposedException, system.InvalidOperationException, system.RankException, system.ArrayTypeMismatchException, system.MissingMethodException, system.reflection.TargetInvocationException, system.threading.WaitHandleCannotBeOpenedException, system.OutOfMemoryException { try { // add reference to assemblyName.dll file addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public SoundPlayer(Stream stream) throws Throwable, system.ArgumentException, system.NotSupportedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.MissingMethodException, system.reflection.TargetInvocationException, system.PlatformNotSupportedException, system.threading.WaitHandleCannotBeOpenedException { try { // add reference to assemblyName.dll file addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject(stream == null ? null : stream.getJCOInstance())); } catch (JCNativeException jcne) { throw translateException(jcne); } } public SoundPlayer(java.lang.String soundLocation) throws Throwable, system.ArgumentException, system.NotSupportedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.MissingMethodException, system.reflection.TargetInvocationException, system.PlatformNotSupportedException, system.threading.WaitHandleCannotBeOpenedException, system.ObjectDisposedException, system.NullReferenceException, system.ArgumentNullException, system.AggregateException, system.IndexOutOfRangeException, system.FormatException, system.globalization.CultureNotFoundException, system.diagnostics.UnreachableException, system.UriFormatException { try { // add reference to assemblyName.dll file addReference(JCOReflector.getUseFullAssemblyName() ? assemblyFullName : assemblyShortName); setJCOInstance((JCObject)classType.NewObject(soundLocation)); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Methods section public void Load() throws Throwable, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentException, system.globalization.CultureNotFoundException, system.NullReferenceException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.UriFormatException, system.diagnostics.UnreachableException, system.ArrayTypeMismatchException, system.io.FileNotFoundException, system.ObjectDisposedException, system.threading.AbandonedMutexException, system.AggregateException, system.TimeoutException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("Load"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void LoadAsync() throws Throwable, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentException, system.globalization.CultureNotFoundException, system.NullReferenceException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.UriFormatException, system.diagnostics.UnreachableException, system.ArrayTypeMismatchException, system.io.FileNotFoundException, system.io.IOException, system.ObjectDisposedException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("LoadAsync"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void Play() throws Throwable, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentException, system.NullReferenceException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.ArgumentNullException, system.InvalidOperationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.UriFormatException, system.ArrayTypeMismatchException, system.ObjectDisposedException, system.io.FileNotFoundException, system.threading.AbandonedMutexException, system.AggregateException, system.TimeoutException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("Play"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void PlayLooping() throws Throwable, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentException, system.NullReferenceException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.ArgumentNullException, system.InvalidOperationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.UriFormatException, system.ArrayTypeMismatchException, system.ObjectDisposedException, system.io.FileNotFoundException, system.threading.AbandonedMutexException, system.AggregateException, system.TimeoutException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("PlayLooping"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void PlaySync() throws Throwable, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentException, system.NullReferenceException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.ArgumentNullException, system.InvalidOperationException, system.globalization.CultureNotFoundException, system.ArgumentOutOfRangeException, system.UriFormatException, system.ArrayTypeMismatchException, system.ObjectDisposedException, system.io.FileNotFoundException, system.threading.AbandonedMutexException, system.AggregateException, system.TimeoutException, system.io.IOException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("PlaySync"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void Stop() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Invoke("Stop"); } catch (JCNativeException jcne) { throw translateException(jcne); } } /** * @deprecated Not for public use because the method is implemented in .NET with an explicit interface. * Use the static ToISerializable method available in ISerializable to obtain an object with an invocable method */ @Deprecated public void GetObjectData(SerializationInfo info, StreamingContext context) throws Throwable { throw new UnsupportedOperationException("Not for public use because the method is implemented with an explicit interface. Use ToISerializable to obtain the full interface."); } // Properties section public boolean getIsLoadCompleted() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (boolean)classInstance.Get("IsLoadCompleted"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setIsLoadCompleted(boolean IsLoadCompleted) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("IsLoadCompleted", IsLoadCompleted); } catch (JCNativeException jcne) { throw translateException(jcne); } } public int getLoadTimeout() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (int)classInstance.Get("LoadTimeout"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setLoadTimeout(int LoadTimeout) throws Throwable, system.ArgumentNullException, system.ArgumentException, system.PlatformNotSupportedException, system.ArgumentOutOfRangeException, system.NotSupportedException, system.globalization.CultureNotFoundException, system.ObjectDisposedException, system.InvalidOperationException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("LoadTimeout", LoadTimeout); } catch (JCNativeException jcne) { throw translateException(jcne); } } public Stream getStream() throws Throwable, system.PlatformNotSupportedException, system.NotSupportedException, system.ArgumentException, system.globalization.CultureNotFoundException, system.NullReferenceException, system.OutOfMemoryException, system.runtime.interopservices.ExternalException, system.ArgumentNullException, system.ArgumentOutOfRangeException, system.InvalidOperationException, system.UriFormatException, system.diagnostics.UnreachableException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("Stream"); return new Stream(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setStream(Stream Stream) throws Throwable, system.ObjectDisposedException, system.PlatformNotSupportedException, system.NullReferenceException, system.NotSupportedException, system.ArgumentNullException, system.ArgumentException, system.AggregateException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("Stream", Stream == null ? null : Stream.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public NetObject getTag() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { JCObject val = (JCObject)classInstance.Get("Tag"); return new NetObject(val); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setTag(NetObject Tag) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("Tag", Tag == null ? null : Tag.getJCOInstance()); } catch (JCNativeException jcne) { throw translateException(jcne); } } public java.lang.String getSoundLocation() throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { return (java.lang.String)classInstance.Get("SoundLocation"); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void setSoundLocation(java.lang.String SoundLocation) throws Throwable, system.ArgumentException, system.NotSupportedException, system.InvalidOperationException, system.ArgumentOutOfRangeException, system.PlatformNotSupportedException, system.ObjectDisposedException, system.NullReferenceException, system.ArgumentNullException, system.AggregateException, system.IndexOutOfRangeException, system.FormatException, system.globalization.CultureNotFoundException, system.diagnostics.UnreachableException, system.OutOfMemoryException, system.UriFormatException { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.Set("SoundLocation", SoundLocation); } catch (JCNativeException jcne) { throw translateException(jcne); } } // Instance Events section public void addLoadCompleted(AsyncCompletedEventHandler handler) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.RegisterEventListener("LoadCompleted", handler); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void removeLoadCompleted(AsyncCompletedEventHandler handler) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.UnregisterEventListener("LoadCompleted", handler); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void addSoundLocationChanged(EventHandler handler) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.RegisterEventListener("SoundLocationChanged", handler); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void removeSoundLocationChanged(EventHandler handler) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.UnregisterEventListener("SoundLocationChanged", handler); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void addStreamChanged(EventHandler handler) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.RegisterEventListener("StreamChanged", handler); } catch (JCNativeException jcne) { throw translateException(jcne); } } public void removeStreamChanged(EventHandler handler) throws Throwable { if (classInstance == null) throw new UnsupportedOperationException("classInstance is null."); try { classInstance.UnregisterEventListener("StreamChanged", handler); } catch (JCNativeException jcne) { throw translateException(jcne); } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy